Javascript examples for DOM HTML Element:Input Range
Input Range name Property - Change the name of a slider control:
<!DOCTYPE html> <html> <body> <input type="range" id="myRange" name="points"> <button onclick="display()">Display name</button> <button onclick="change()">Change name</button> <script> function display() { var x = document.getElementById("myRange").name; console.log("The name of the slider control is: " + x); } function change() {//from ww w . ja v a2 s .co m var x = document.getElementById("myRange").name = "newRangeName"; console.log("The name was changed to: " + x); } </script> </body> </html>