4 .first { display: inline; color: green; }
5 .second { display: block; color: red; }
8 var className =
"first";
9 function toggleClass() {
10 var node = document.getElementById(
"foo");
11 if (className ==
"first") {
17 node.className = className;
22 <H1>Changing CLASS test
</H1>
23 <P>Clicking on the button that follows this paragraph
24 should change the layout of
<SPAN ID=
"foo" CLASS=
"first">these words
</SPAN>
25 with respect to the rest of the flow.
</P>
27 <INPUT TYPE=
"button" VALUE=
"Toggle class" onClick=
"toggleClass(); return true;">