> I'd choose this approach in order to avoid typing the class name "on" in
> more than one place (which may lead to errors if you want to change that
> one and forget it somewhere - not here maybe but in larger chunks of code).

It actually avoids duplicating the whole code to access the parent, not
only the class name...

Yes Klaus, but lets say the focus function gets called twice (through
malicious javascript or a quirky browser) then the toggle state of the
class will be off. But in general I prefer your implementation.

~Sean

Reply via email to