我arindic
使用document.ready()
.
然后在它们的动态生成结束后,仍然在document.ready()
例程中,我将这些元素与keypress
事件绑定,如下所示:
$('.arindic').bind('keypress', function(evt){
// do lots of stuff
});
但它不起作用。我知道“做很多事情”的功能运行良好,因为在底部document.ready()
我有这个:
$('.arindic').keypress(function(evt){ // do lots of stuff // });
这适用于页面上已经静态存在的文本区域。我绑定动态元素的方式有问题吗?而不是.bind()
我也尝试过.on()
,.live()
但无济于事。