diff options
Diffstat (limited to 'test/js/prev_next_parent_child.html')
-rw-r--r-- | test/js/prev_next_parent_child.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/js/prev_next_parent_child.html b/test/js/prev_next_parent_child.html new file mode 100644 index 00000000..85abe7fe --- /dev/null +++ b/test/js/prev_next_parent_child.html @@ -0,0 +1,22 @@ +<!doctype html> +<main> +<div id=x>Fail</div> +test +<a id=y>test test</a> +</main> +<script> +(function() { + let x = document.getElementById("x") + let y = document.getElementById("y"); + if (y.previousSibling === x) return; + if (y.previousSibling.textContent.trim() !== "test") return; + if (y.previousElementSibling !== x) return; + if (x.nextElementSibling !== y) return; + if (x.nextSibling.textContent.trim() !== "test") return; + x.nextSibling.remove(); + x.nextSibling.remove(); + if (x.parentElement.children.length !== 1) return; + if (x.parentElement.children[0] !== x) return; + x.textContent = "Success"; +})() +</script> |