问题是,我有一些动态创建的输入标记集,并且我还有一个函数,该函数在输入值发生变化时触发。
$('input').on('change', function() {
// Does some stuff and logs the event to the console
});
但是,.on('change')
不会为任何动态创建的输入触发,只会为加载页面时存在的项触发。不幸的是,这让我有点为难,因为.on
是.live()
和.delegate()
的替代品,所有这些都是.bind()
的包装器:/
还有没有其他人遇到过这个问题或者知道解决方案?
https://stackoverflow.com/questions/13418963
复制相似问题