Jquery live keyup not working
I have text box
<input type="text" name="extraQty0" class="extraEvent" value="1"/>
used following code
$(".extraEvent").live('keyup',function(){
alert('test');
});
This is not working But if i use 'click' instead of 'keyup' the alert will work. What coul开发者_StackOverflow中文版d be wrong?
As mentioned in the comments, you are using jQuery version 1.3.1. Support for the keyup
event for live()
wasn't introduced until later. Update your jQuery to either the latest version or at least 1.4.x and you should be fine.
Source
That's strange. Could you try this:
$(document).ready(function(){
$(".extraEvent").live('keyup', function(){
alert('test');
});
});
Hope this helps. Cheers
精彩评论