Re: Proposal: regular expressions (or wildcards) in selectors

Quoth Christoph Päper on 3/16/2004 6:15 PM...

>>onmouseover="this.className += ' IEhover'"
> 
> 
> You'll get a very long 'className' after some hovers with this. Use a simple
> function that only adds the string if it's not already set.

Even if I pair the onmouseover with
[onmouseout="this.className = this.className.replace(' IEhover','')]? I can't 
picture "onmouseover" being fired twice without an "onmouseout" in between...but 
of course that doesn't mean it can't happen.

> I'm not that much into DOM issues, but I think, 'className' should have been
> defined to return an array, not a string. At least there should be an easy way
> to treat strings as space or comma separated lists (other than '.split()').

I'd agree, but this way the DOM gives exactly what is specified in the HTML. 
You're right, though, in that it's treated more like an array/list (esp. by the 
browser), so hm, maybe.

I think a better name for the DOM object would be most in order. "className" is 
kinda counterintuitive; combined with the scant documentation of this feature in 
CSS tutorials (even in the spec, AFAIK), I think it prevents web designers from 
learning and using a very powerful feature of CSS.

-Felipe Gasper
Urbana, IL

Received on Tuesday, 16 March 2004 19:31:00 UTC