1
我想在用户更改JQuery范围控件上的值时更新值。我试图按照给出的示例here,但它不起作用。JQuery范围事件未触发。
$(document).ready(function() {
alert('ready1'); //This fires when the page loads.
// Logs the value while the user is moving the slider
$('.price-min').on('input', getValue);
function getValue(e) { //This never fires
var val = $(e.element).val();
alert(val);
}
});
HTML:
<div data-role="rangeslider">
<input type="range" name="price-min" id="price-min" value="200" min="0" max="1000">
<input type="range" name="price-max" id="price-max" value="800" min="0" max="1000">
</div>
有人能告诉我,我错了?
不应该被宣布为功能您尝试使用它之前 – Epirocks
你是不是在尝试绑定事件处理程序选择的任何元素。 id/name!= class – CBroe