Bind the mouseover event handler to the <body> element. In this handler, check the "target" property of each event that it catches, and see if its "tagName" "A" property. If so, call the handler.
The live function uses the bubbling event, which is the name of the browser process to check handlers from the target element to the DOM root, one parent at a time. Since each <a> in your document can ultimately be traced back to <body> , this root node will receive all mouse events that will not be disabled by lower-level handlers that cancel bubbling (via the stopPropagation () method on the event object or some weird way specific to the browser, I suppose).
However, not all event bubbles. I'm looking for a good link ... here, the MDC page seems pretty good , although maybe a little old.
Pointy
source share