jQuery Not Selector and Live Binding

Posted by ahsteele on Stack Overflow See other posts from Stack Overflow or by ahsteele
Published on 2010-04-07T00:21:54Z Indexed on 2010/04/07 0:23 UTC
Read the original article Hit count: 715

Filed under:
|

I am trying to bind all of the a elements on a page except for those with the title attribute of on. The code below ends up not attaching the click event to any of the a elements on the page. If I remove the not it works but of course binds to a elements I do not want the code applied to. What am I doing wrong with the not selector?

$(document).ready(function() {
     $('a').not('title=on').live('click', function(event) { ... });
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-selectors