Which one is better for performance when attaching events (click, mouseover, mouseout, etc…)? I am attaching a lot of event listeners to my elements in liu of :hover events and am wondering if there is a performance difference between the two.
Which one is better for performance when attaching events (click, mouseover, mouseout, etc…)? I
Share
You’re thinking of it in the wrong way. live() is a very expensive observer, avoid it if you can and use delegate() instead. If you are not using ajax or javascript to create DOM nodes after DOMready, then you don’t have to worry about attaching an observer to the event: