js 实时监听textarea输入
html:
<textarea class="area" name="" id="text1" maxlength="100" oninput="checkTxt()"></textarea> <p class="notice">已输入<span id="num">0</span>个字</p>
js:
function checkTxt() { var obj = $('#text1'), len = obj.val().length; $('#num').html(len); }