HTML5 input type range show range value

后端 未结 12 1362
野趣味
野趣味 2020-11-28 01:51

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

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 02:27

    For those who are still searching for a solution without a separate javascript code. There is little easy solution without writing a javascript or jquery function:

    
    24

    JsFiddle Demo

    If you want to show the value in text box, simply change output to input.


    Update:

    It is still Javascript written within your html, you can replace the bindings with below JS code:

     document.registrationForm.ageInputId.oninput = function(){
        document.registrationForm.ageOutputId.value = document.registrationForm.ageInputId.value;
     }
    

    Either use element's Id or name, both are supported in morden browsers.

提交回复
热议问题