<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript" src="jquery.js"></script><script type="text/javascript">??? $(function () {??????? $('input').bind('input propertychange', function() {??????????? $len = $(this).val().length;??????????? if ($len == 0) {??????????????? $('span').html('');??????????? } else if ($len >= 6) {??????????????? $('span').html($(this).val().length).css('color', 'black');??????????? } else {??????????????? $('span').html($(this).val().length).css('color', 'red');??????????? }?????????? ???????? })??? })</script></head><body>??? <form>??????? <input maxlength="12" type="password" placeholder="password">??????? <span></span>??? </form></body></html>通過右鍵菜單菜單中的剪切和刪除命令刪除內容的時候不會觸發(fā),?怎么能觸發(fā)呢?
oninput 和 onpropertychange 這兩個事件在 IE9 中都有個小BUG
hhhzihao2
2016-05-07 23:16:18