<html>
<body>
<h1>The Element Object</h1>
<h2>The insertAdjacentText() Method</h2>
<p>Click "insert" to insert some text inside the header:</p>
<button onclick="myFunction()">Insert</button>
<h2 id="myH2">My Header</h2>
<script>
function myFunction() {
const h2 = document.getElementById("myH2");
let text = "My inserted text";
h2.insertAdjacentText("beforeend", text);
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_node_insertadjacenttext4 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:39:44 GMT -->
</html>