Update: As of jQuery 1.4, $.live()
now supports focusin and focusout events.
jQuery currently1 doesn
live()
is jQuery's shortcut to event delegation. To answer your question, see Delegating the focus and blur events.
It's pretty ingenious: for standards compliant browsers he uses event capturing to trap those events. For IE he uses IE's proprietary focusin
(for focus
) and focusout
(for blur
) events, which do bubble, allowing traditional event delegation.
I'll leave the porting of it to jQuery as an exercise.