HTML5 type=range - showing label

后端 未结 7 2073
心在旅途
心在旅途 2021-02-12 13:25

Is there a way I can also set some label text for each steps in the HTML5 type=range control. Basically I have a range control

相关标签:
7条回答
  • 2021-02-12 13:52

    Here's an alternative solution, no jQuery required. Uses the HTML5 oninput event handler, and valueAsNumber property of the input element.

    Works on my machine certification: Chrome v54

    <form name="myform" oninput="range1value.value = range1.valueAsNumber">
      <input name="range1" type="range" step="1" min="0" max="4" value="1">  
      <output name="range1value" for="range1" >1</output>
    </form>

    0 讨论(0)
提交回复
热议问题