Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset=utf-8>
<title>ParentNode.children</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div style="display: none">
<ul><li id='test'>1</li><li>2</li><li>3</li><li>4</li></ul>
</div>
<script>
test(() => {
var node = document.getElementById("test");
var parentNode = node.parentNode;
var children = parentNode.children;
assert_true(children instanceof HTMLCollection);
var li = document.createElement("li");
assert_equals(children.length, 4);
parentNode.appendChild(li);
assert_equals(children.length, 5);
parentNode.removeChild(li);
assert_equals(children.length, 4);
}, "ParentNode.children should be a live collection");
</script>
</html>