I am making a website where I want to use range slider(I know it only supports webkit browsers).
I have integrated it fully and works fine. But I would like to use a
Shortest version without form
, min
or external JavaScript.
Explanation
If you wanna retrieve the value from the output
you commonly use an id
that can be linked from the oninput
instead of using this.nextElementSibling.value
(we take advantage of something that we are already using)
Compare the example above with this valid but a little more complex and long answer:
With the shortest answer:
this
, something weird in JS for newcomersinput
placing the id
in the output
Notes
min
value when equal to
0
this
keyword makes it a better language