Get content of a DIV using JavaScript
<p>I have two DIV's called DIV1 and DIV2 and DIV1 consists of dynamic content and DIV2 is empty. I need content of DIV1 to be displayed in DIV2. How can I do it.</p>

<p>I coded in below manner which is not working. Anybody please correct it.</p>

<pre><code>&lt;script type="text/javascript"&gt;

   var MyDiv1 = Document.getElementById('DIV1');
   var MyDiv2 = Document.getElementById('Div2');
   MyDiv2.innerHTML = MyDiv2; 

&lt;/script&gt;
&lt;body&gt;
&lt;div id="DIV1"&gt;
 // Some content goes here.
&lt;/div&gt;

&lt;div id="DIV2"&gt;
&lt;/div&gt;
&lt;/body&gt;
</code></pre>
