input监听

<h1>
    实时监测input中值的变化
</h1>
<input type="text" id="username" autocomplete="off">
<div id="result"></div>
$(function() {
    $('#username').bind('input propertychange', function() {
        $('#result').html($(this).val().length + ' characters');
    });
})
原文地址:https://www.cnblogs.com/phpfensi/p/7298602.html