I am working on a site that unfortunately uses mootools. I am trying to trigger an event when any link on the page is clicked apart from if the link has a certain id. Here is my code:
$$('a:not(#learn-more)').addEvent('click', function(){
alert("");
});
If i remove the :not(#learn-more) from the selector then the event gets triggered when any link is clicked, but with the :not() in then nothing happens. I don’t get any errors or anything just nothing happens. Anyone got any ideas whats going on?
Update: It is using mootools version 1.2.4
I believe the not selector is broken in version 1.2.4, I think using
not([id=learn-more])might work howevernot(#learn-more)will not.For this to work you will need to upgrade to version 1.3 in which the issue was fixed.