3
<h1>Attribute tests for UL and LI elements</h1>
13
<li id="3rd">Three</li>
17
Use the buttons below to change the attributes of the UL and LI elements.
22
Set UL element's <I>type</I> to
23
<SELECT SIZE="1" NAME="type">
24
<OPTION SELECTED VALUE="disc">disc</OPTION>
25
<OPTION VALUE="circle">circle</OPTION>
26
<OPTION VALUE="square">square</OPTION>
28
<INPUT TYPE="button" VALUE="Change Type" onClick="changeType(); return true;">
32
<SELECT SIZE="1" NAME="nth">
33
<OPTION SELECTED VALUE="1st">1st</OPTION>
34
<OPTION VALUE="2nd">2nd</OPTION>
35
<OPTION VALUE="3rd">3rd</OPTION>
37
LI element's <I>type</I> attribute to
38
<SELECT SIZE="1" NAME="type2">
39
<OPTION SELECTED VALUE="disc">disc</OPTION>
40
<OPTION VALUE="circle">circle</OPTION>
41
<OPTION VALUE="square">square</OPTION>
43
<INPUT TYPE="button" VALUE="Change Type" onClick="changeElementType(); return true;">
47
var ul = document.getElementById("myul");
48
function changeType() {
49
if (document.forms[0].type.selectedIndex == 0) {
52
else if (document.forms[0].type.selectedIndex == 1) {
60
// We should be able to do this with the select elements value, but
61
// since that doesn't work we need to maintain this array.
62
var nth = new Array("1st", "2nd", "3rd");
63
function changeElementType() {
64
var li = document.getElementById(nth[document.forms[0].nth.selectedIndex]);
65
if (document.forms[0].type2.selectedIndex == 0) {
68
else if (document.forms[0].type2.selectedIndex == 1) {
b'\\ No newline at end of file'