Skip to content

Commit

Permalink
Add test sample testSplitText
Browse files Browse the repository at this point in the history
  • Loading branch information
buffer committed Jun 7, 2021
1 parent 737c37c commit 24ab5d1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/samples/misc/testSplitText.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<html>
<body>

<p>foobar</p>

<script>
var p = document.querySelector('p');
var foobar = p.firstChild;

alert("p.childNodes.length before splitText: " + p.childNodes.length);

const bar = foobar.splitText(3);

alert("foobar value after splitText: " + foobar.nodeValue);
alert("bar value: " + bar.nodeValue);
alert("p.childNodes.length after splitText: " + p.childNodes.length);
</script>
</body>
</html>

0 comments on commit 24ab5d1

Please sign in to comment.