dom/tests/js/class.html
author Jonas Sicking <jonas@sicking.cc>
Wed, 25 Feb 2009 00:20:25 -0800
changeset 23418 4933de6ea0749db930033fcb66d7607a76ee01a7
parent 1 9b2a99adc05e53cd4010de512f50118594756650
permissions -rw-r--r--
Backed out changeset 223c4d40bb76 (bug 479521)

<HTML>
<HEAD>
<STYLE>
 .first  { display: inline; color: green; }
 .second { display: block; color: red; }
</STYLE>
<SCRIPT>
var className = "first";
function toggleClass() {
  var node = document.getElementById("foo");
  if (className == "first") {
    className = "second";
  }
  else {
    className = "first";
  }
  node.className = className;
}
</SCRIPT>
</HEAD>
<BODY>
<H1>Changing CLASS test</H1>
<P>Clicking on the button that follows this paragraph 
should change the layout of <SPAN ID="foo" CLASS="first">these words</SPAN>
with respect to the rest of the flow.</P>
<FORM>
<INPUT TYPE="button" VALUE="Toggle class" onClick="toggleClass(); return true;">
</FORM>
</BODY>
</HTML>