J
Jeff Gutsell
Occasionally, in creating a static page I have assigned two classes to
an element. For example: "class = 'BodyText Note'." It's a neat way
of streamlining my stylesheets.
However, I have never been able to use JavaScript to dynamically add a
second class to an element. I'm guessing that this involves some
string concatenation, and I must be making some silly mistake. The
type of approach I've tried has been:
theElement.className = 'AClass' + ' ' + 'AnotherClass'.
Jeff
Firefox Rules
an element. For example: "class = 'BodyText Note'." It's a neat way
of streamlining my stylesheets.
However, I have never been able to use JavaScript to dynamically add a
second class to an element. I'm guessing that this involves some
string concatenation, and I must be making some silly mistake. The
type of approach I've tried has been:
theElement.className = 'AClass' + ' ' + 'AnotherClass'.
Jeff
Firefox Rules