jquery监听div、input、textarea内容变化


第一种:change事件

change事件在元素的值发生变化时触发,适用于input、textarea、select

$("#demo").bind("change", function(){
    alert('a');
});

第一种:DOMNodeInserted事件(插入事件)、DOMNodeInserted事件(移除事件)

DOMNodeInserted事件只有在插入节点时有效,相反DOMNodeRemoved事件,只有在移除节点时有效。
$('#demo').bind('DOMNodeInserted', function() {
   alert('a') 
})
$('#demo').bind('DOMNodeRemoved', function() {
   alert('b') 
})


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM