4 ms·
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 e
by dakridge 13y 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/ http://jsfiddle.net/W3Stf/
- ondras 13y agoThat 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.
- ondras 13y ago(but as you see, I soon switched to onevent-only approach, naturally)