File: node_append_child.htm

package info (click to toggle)
selfhtml 8.1.1-1
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k, lenny
  • size: 27,660 kB
  • ctags: 4,145
  • sloc: xml: 614; java: 375; makefile: 8
file content (21 lines) | stat: -rw-r--r-- 764 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Test</title></head>
<body>
<ol id="Liste"><li id="q">Element</li></ol>
<script type="text/javascript">
document.getElementById("Liste").removeChild(document.getElementById("Liste").firstChild);

for (var i = 0; i < 10; i++) {
  var newLI = document.createElement("li");
  var liNummer = i + 1;
  var newLIText = document.createTextNode("Das ist Listeneintrag Nummer " + liNummer);
  document.getElementById("Liste").appendChild(newLI);
  document.getElementsByTagName("li")[i].appendChild(newLIText);
}
</script>

<p><a href="../node.htm#append_child">zur&uuml;ck</a></p>
</body>
</html>