<input type="text" id="test" οninput='fromChange()'>
1、注册监听
$(document).on('input', '#test', function () {console.log($("#test").val() ); });
2、事件监听
function fromChange() {
console.log($("#test").val() );
}
<input type="text" id="test" οninput='fromChange()'>
1、注册监听
$(document).on('input', '#test', function () {console.log($("#test").val() ); });
2、事件监听
function fromChange() {
console.log($("#test").val() );
}
转载于:https://www.cnblogs.com/wxy520/p/10100595.html