1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/js/class.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 1.4 +<HTML> 1.5 +<HEAD> 1.6 +<STYLE> 1.7 + .first { display: inline; color: green; } 1.8 + .second { display: block; color: red; } 1.9 +</STYLE> 1.10 +<SCRIPT> 1.11 +var className = "first"; 1.12 +function toggleClass() { 1.13 + var node = document.getElementById("foo"); 1.14 + if (className == "first") { 1.15 + className = "second"; 1.16 + } 1.17 + else { 1.18 + className = "first"; 1.19 + } 1.20 + node.className = className; 1.21 +} 1.22 +</SCRIPT> 1.23 +</HEAD> 1.24 +<BODY> 1.25 +<H1>Changing CLASS test</H1> 1.26 +<P>Clicking on the button that follows this paragraph 1.27 +should change the layout of <SPAN ID="foo" CLASS="first">these words</SPAN> 1.28 +with respect to the rest of the flow.</P> 1.29 +<FORM> 1.30 +<INPUT TYPE="button" VALUE="Toggle class" onClick="toggleClass(); return true;"> 1.31 +</FORM> 1.32 +</BODY> 1.33 +</HTML>