netsurf/test/js/doc-dom2.html

18 lines
617 B
HTML

<html>
<head>
<title>DOM getElementById</title>
<link rel="stylesheet" type="text/css" href="tst.css">
</head>
<body>
<h1>DOM getElementById element reference</h1>
<noscript><p>Javascript is disabled</p></noscript>
<p>This shows the text content of an element obtained using <a href="http://dom.spec.whatwg.org/#dom-document-getelementbyid">document.getElementById</a></p>
<p>Referenced text</p>
<p id="reftext">DOM getElementById element referenced test text</p>
<p>Inserted text</p>
<p><script>document.write(document.getElementById("reftext").textContent);</script></p>
<p>After inserted text</p>
</body>
</html>