我試圖給我的代碼添加「jQuery textchange插件」。那就是:http://www.zurb.com/playground/jquery-text-change-custom-eventjQuery textchange插件不起作用
這裏是我的代碼的部分,我認爲這將是不夠的:
page.html中:
//...other code
<script type="text/javascript" src="resources/javascripts/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="resources/javascripts/jquery.textchange.js"></script>
<script type="text/javascript" src="resources/javascripts/formscript.js"></script>
//...other code
//...
<input type="text" placeholder='placeholder' class='necess'>
//...other code
fornscritp.js:
//...other code
$(document).ready(function() {
$(".necess").bind("hastext", function() {
alert('YES');
});
});
所以我想看到消息'是',當我開始在我的INPUT中輸入東西時,但不幸的是它確實不工作。
我嘗試使用「textchange」,嘗試將標記從INPUT更改爲TEXTAREA,就像網站上的示例一樣,但它也沒有幫助。
我花了數小時,嘗試GOOGLE IT,但沒有找到答案。甚至認爲我使用這個插件是錯誤的。
請告訴我,我做錯了什麼!
工程就像一個魅力:http://jsfiddle.net/7SZ68/ – hjpotter92