×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Peter Hempel
Added: Sep 17, 2017 2:42 PM
Views: 2
Tags: dom childnode
DOM manipulation
  1. <h1 id="id01">My First Page</h1>
  2. <p id="id02"></p>
  3.  
  4. <script>
  5. document.getElementById("id02").innerHTML = document.getElementById("id01").childNodes[0].nodeValue;
  6. </script>