2012-11-18 16:59:10 +04:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>DOM previousElementSibling and nextElementSibling reference</title>
|
|
|
|
<!-- comment node should be skipped -->
|
|
|
|
<link rel="stylesheet" type="text/css" href="tst.css">
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>DOM previousElementSibling and nextElementSibling reference</h1>
|
2016-02-04 18:11:19 +03:00
|
|
|
<noscript><p>Javascript is disabled</p></noscript>
|
2012-11-18 16:59:10 +04:00
|
|
|
<!-- comment node should be skipped -->
|
|
|
|
<p><b>head.lastElementChild.previousElementSibling:</b> <script>document.write(document.head.lastElementChild.previousElementSibling.textContent);</script></p>
|
|
|
|
<!-- comment node should be skipped -->
|
|
|
|
<p><b>body.firstElementChild.nextElementSibling:</b> <script>document.write(document.body.firstElementChild.nextElementSibling.textContent);</script></p>
|
2015-10-21 19:46:43 +03:00
|
|
|
<h1>DOM nodes should be 'null' if not present</h1>
|
|
|
|
<p><b>head.firstElementChild.previousElementSibling:</b> <script>document.write(document.head.firstElementChild.previousElementSibling);</script></p>
|
|
|
|
<p><b>head.firstElementChild.nextElementSibling.nextElementSibling:</b> <script>document.write(document.head.firstElementChild.nextElementSibling.nextElementSibling);</script></p>
|
2012-11-18 16:59:10 +04:00
|
|
|
</body>
|
|
|
|
</html>
|