jQuery Mobile: how to get the change event of a range Slider?

后端 未结 2 1569
走了就别回头了
走了就别回头了 2020-12-21 20:27

What I am trying to do is just like the code: when the value is greater than 10, display >10, or display 1 - 10. It works fine. However, if I uncomment the jquery mobile , i

2条回答
  •  温柔的废话
    2020-12-21 20:38

    I would suggest you to wrap input within a div and attach change event to that particular div, through which you can get the value of slider. Working Snippet below.

    $("#slider").change(function() {
      $("#display").text($('#range').val()<=10?'1-10':'>10');
    });
    
    
    
    

    display

提交回复
热议问题