dom/tests/js/id.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <HTML>
michael@0 2 <HEAD>
michael@0 3 <STYLE>
michael@0 4 #first { display: inline; color: green; }
michael@0 5 #second { display: block; color: red; }
michael@0 6 </STYLE>
michael@0 7 <SCRIPT>
michael@0 8 var id = "first";
michael@0 9 function toggleId() {
michael@0 10 var node = document.getElementById(id);
michael@0 11 if (id == "first") {
michael@0 12 id = "second";
michael@0 13 }
michael@0 14 else {
michael@0 15 id = "first";
michael@0 16 }
michael@0 17 node.id = id;
michael@0 18 }
michael@0 19 </SCRIPT>
michael@0 20 </HEAD>
michael@0 21 <BODY>
michael@0 22 <H1>Changing ID test</H1>
michael@0 23 <P>Clicking on the button that follows this paragraph
michael@0 24 should change the layout of <SPAN ID="first">these words</SPAN>
michael@0 25 with respect to the rest of the flow.</P>
michael@0 26 <FORM>
michael@0 27 <INPUT TYPE="button" VALUE="Toggle ID" onClick="toggleId(); return true;">
michael@0 28 </FORM>
michael@0 29 </BODY>
michael@0 30 </HTML>

mercurial