Reputation: 29186
I have some text boxes, all of which have the same class "addExamNumberBoxStyle". Now I want to bind a "blur" handler to each one of these. When I use direct "blur" event like below -
$('.addExamNumberBoxStyle').blur(function()
{
alert("Hello World");
});
it works perfectly. But when I use "live" function like below -
$('.addExamNumberBoxStyle').live('blur', function()
{
alert("Hello World");
});
it does not work.
Why?
Upvotes: 0
Views: 270
Reputation: 944555
Presumably because you don't have a new enough version of jQuery
In jQuery 1.3.x only the following JavaScript events (in addition to custom events) could be bound with .live(): click, dblclick, keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover, and mouseup.
As of jQuery 1.4 the .live() method supports custom events as well as all JavaScript events. As of jQuery 1.4.1 even focus and blur work with live (mapping to the more appropriate, bubbling, events focusin and focusout).
Upvotes: 1