JS:
var count = 0;
jQuery(function () {
$('.input').live('input', function () {
//any instructions here
count++;
$('.count').text(count);
});
});
HTML:
<textarea class="input" /></textarea>
<br /> <span class="count"></span>
我想在 IE 中做同样的事情。这适用于所有浏览器,但不适用于 IE ......
我不能使用live('keyup')
,因为这必须“粘贴”。
在IE中也live('paste')
不起作用。
我想在键入字符(使用键盘)或粘贴字符(右键单击 > 粘贴 [使用鼠标])时执行指令。