Jump to content

Search the Community

Showing results for tags 'step attribute'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hi, I have a suggestion for improving the Input Range step Property, here: https://www.w3schools.com/jsref/prop_range_step.asp I found that the Try It Yourself code lacks context as it doesn't show a value, min or max attribute in the input element so the step attribute doesn't have much meaning. https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_range_step Here is my suggestion for improving the code. You may want to remove the Try it button seeing as the innerHTML is being updated each time the slider changes: Thanks, Roland <!DOCTYPE html> <html> <body> Points: 1 <input type="range" id="myRange" value="5" step="1" min="1" max="10"> 10 <p>Click the button to display the value and the step attribute of the slider control.</p> <button onclick="myFunction()">Try it</button> <p><strong>Note:</strong> input elements with type="range" are not supported in IE 9 and earlier versions.</p> <p id="demo"></p> <script> function myFunction() { var step = document.getElementById("myRange").step; var value = document.getElementById("myRange").value; document.getElementById("demo").innerHTML = 'step:' + step + ', value:' + value; } document.getElementById("myRange").addEventListener('input', function(e) { myFunction(); }); myFunction(); </script> </body> </html>
×
×
  • Create New...