How to get/fetch HTML5 Range Slider's value in PHP?

前端 未结 2 1958
攒了一身酷
攒了一身酷 2021-01-03 10:53

How do I get the value of my range slider that sits in a form?

I cant get a value from it by just asking from the name.

I use this JavaScript function to typ

2条回答
  •  粉色の甜心
    2021-01-03 11:39

    document.getElementById("range").value should get the current value of the slider.

    To make changes to the value this will then be the javascript.code;

    function showValue(newValue) {
        document.getElementById("range").value = newValue; }
    

    If you render the slider by PHP you could simply insert the value directly:

    
    

提交回复
热议问题