实时监听 input值的变化

重点:$('#xx').bind('input propertychange', function() {}

举例子:

html:

<div ><span id="number2">0</span>&nbsp;&nbsp;<input type="range" name="number" min="0" max="10"  class="ranger" id="number" /></div>

js:

$('#number').bind('input propertychange', function() {
        document.getElementById('number2').innerHTML = document.getElementById('number').value;
    });

结果:

 

猜你喜欢

转载自www.cnblogs.com/wanlibingfeng/p/9228438.html
0条评论
添加一条新回复