嘿,在jquery和hmtl5范围上有点小麻烦。我正在尝试获取更改后的值,但事件侦听器没有捕获到它。目前我的代码是:
HTML
html += '<li>Apply Credits: <input type="range" min="0" max="'+credits+'" name="discount_credits" id="discount_credits" /> <span>'+credits+'</span></li>'
JS是:
$('#discount_credits').mousewheel( function() {
alert('it changed!');
alert('new value = ' + $(this).val());
});
我也试过
$('#discount_credits').change( function() {
alert('it changed!');
alert('new value = ' + $(this).val());
});
两种方法似乎都不管用。我做错了什么吗?
https://stackoverflow.com/questions/10473554
复制相似问题