title: Copy text displayed from div to another div
body: <p>I am having a problem here about copying a text that displays from div (the display comes from jquery) to another div (using javascript). </p>
  
  <p>Here is my code: </p>
  
  <pre><code>&lt;body onload="copyDiv();"&gt;
    &lt;div id="first_div"&gt;&lt;/div&gt;
    &lt;div id="second_div"&gt;&lt;/div&gt;
  &lt;/body&gt;
  
  &lt;script&gt;
     // this function provides text for first_div
   $(document).ready(function() {
    $("#first_div").html('Testing');
   });
  
     // this function copies the text that comes from first_div to second_div
     function copyDiv() {
        var firstDivContent = document.getElementById('first_div');
        var secondDivContent = document.getElementById('second_div');
        secondDivContent.innerHTML = firstDivContent.innerHTML;
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>My expected output is, the jquery will provide the text for the first_div, and the javascript function will copy the text from first_div into the second_div. Thanks in advance</p>