HTML Link and Jquery Live Only Works on First Try with one click

Posted by Jon on Stack Overflow See other posts from Stack Overflow or by Jon
Published on 2010-03-31T14:01:56Z Indexed on 2010/03/31 14:03 UTC
Read the original article Hit count: 244

Hi Everyone,

I'm running into a problem with jquery live event binding on a link. When the link is added to the page it works fine, however when another link is added to the unordered list it requires two clicks for the click event to fire on either link. Any ideas?

$("div#website-messages ul li a").live("click", function() {
    var link = $(this);
    changeTab(link.attr("href"));
    $(link.attr("title")).focus();
    return false;
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about live