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());
});
どちらも機能していないようです。私は何か間違ったことをしていますか?