"Arjen" <bo*****@hotmail.com> writes:
className
Then it adds classname as attributename...
No. The HTML attribute is called "class". The corresponding DOM
property is called "className".
but it must be class. If tried to run your solution and it doesn't
work... other options?
Try it again, it is correct:
---
<style type="text/css">
.foo {color:red;background:yellow;}
.bar {color:yellow;background:red;}
</style>
<div class="foo" onclick="this.className='bar'">CLICK</div>
---
//L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'