netsurf/test/js/dom-element-reflection.html

22 lines
908 B
HTML
Raw Normal View History

<html>
<head>
<title>DOM element reflection reference</title>
<link rel="stylesheet" type="text/css" href="tst.css">
</head>
<body>
<h1 id="header" class="normal">DOM firstElementChild reference (#header .normal)</h1>
<p><b>body.firstElementChild.id:</b> <script>document.write(document.body.firstElementChild.id);</script></p>
<p><b>body.firstElementChild.className:</b> <script>document.write(document.body.firstElementChild.className);</script></p>
<script>
document.body.firstElementChild.id = "replacedid"
document.body.firstElementChild.className = "replacedclass"
</script>
<h1>DOM firstElementChild reference (#replacedid .replacedclass)</h1>
<p><b>body.firstElementChild.id:</b> <script>document.write(document.body.firstElementChild.id);</script></p>
<p><b>body.firstElementChild.className:</b> <script>document.write(document.body.firstElementChild.className);</script></p>
</body>
</html>