我有一个范围,我想更新立即显示其数字值的范围。我拥有的代码有效,但是仅在您停止按住鼠标左键时才显示数字值。
这是我所拥有的:
$("#length").change(function(){ // when range is altered, execute function
len = $("#length").val(); // set variable "len" to the numeral value of range
$("#password-length").html(len); // set "len" (numeral value) to a span
});
小提琴。
在这种情况下:
$("#length").on('input change', function(){
$("#password-length").html(this.value);
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句