1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00
elinks/test/ecmascript/children.html
Witold Filipczyk 70a9e53a36 [js] element.children
innerHTML does not accept non-xhtml
2021-06-07 15:41:28 +02:00

25 lines
427 B
HTML

<!DOCTYPE html>
<html>
<body>
<p>Click the button to get the tag names of the body element's children.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var c = document.body.children;
var txt = "";
var i;
for (i = 0; i < c.length; i++) {
txt = txt + c[i].tagName + "<br/>";
}
document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
</html>