Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Date: Fri, 9 Aug 2019 14:53:50 +0200 Lines: 79 Message-ID: References: <7289e763-fc8c-4686-8f68-12094ee06440@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net jPFxG2DuBvOLBeegCJpuIABEHTSBNjss7Am+9im2toI+KFGvM+ Cancel-Lock: sha1:HkE5k168aADnpMsnEgZcnK7fuT4= In-Reply-To: Content-Language: en-US Xref: csiph.com comp.lang.javascript:37071 On 09.08.19 13:54, Evertjan. wrote: > Arno Welzel wrote on 09 Aug 2019 in > comp.lang.javascript: > >> On 09.08.19 01:50, Jonas Thörnvall wrote: >> >>> >> max="127" orient="vertical"/> >>> >>> Well i guess it is not, korgvol() will not know it was called from >>> korgvol1? >> >> Wrong. >> >> See >> > hange> > > So what is so wrong with: > > onChange="korgvol(this)" > > or > > onChange="korgvol(this.value)" The first one is correct. You pass a reference to the element itself, so you can query the value and the id from the element. Also note, that "orient" is not a valid attribute! This is only specific to Firefox and not allowed in HTML5. If you want to get a slider which is vertical and uses valid HTML you need to use CSS. Also see: Minimal example: Example for onChange
-- Arno Welzel https://arnowelzel.de