- From: Dean Edwards <dean@edwards.name>
- Date: Wed, 20 Apr 2005 19:30:17 +0100
Brad Neuberg wrote:
> * Right now most people directly access an elements className property,
> without realizing that they might be clobbering multi-classed elements
> (i.e. something with class="class1 class2"). I usually have to create
> wrapper methods to ensure that this doesn't happen, such as
> xAddClass(target, className), xRemoveClass(target, className), and
> xHasClass(target, className), but it would be much nicer if the
> className property itself had better support for multi-classed
> elements. Some example possibilities of what this might look like:
> * someElement.className.add("someNewClass")
> * someElement.className.remove("SomeOldClass")
> * someElement.className.hasClass("someClass")
>
+1
Received on Wednesday, 20 April 2005 11:30:17 UTC