Hacker News new | ask | show | jobs
by dakridge 4594 days ago
Just curious - shouldn't the events be attached to the parent table and delegated to the children inputs so you are not attaching the focus and blur events to each individual input? Similar to something like this: http://jsfiddle.net/W3Stf/
2 comments

That is a cool improvement. The "focus" and "blur" events do not bubble, so I initially tried to evade event delegation - with respect to legacy event handling (attachEvent) that does not support the capture phase you used.
(but as you see, I soon switched to onevent-only approach, naturally)