Replacing the content of a Tag in HTML using java script
<p>Html:</p>

<p>Input:  </p>

<pre><code>    &lt;div id="ABC"&gt;
        &lt;div id="DEF"&gt;
        &lt;a title="Google" href="http://google.com"&gt;google.com&lt;/a&gt;
        &lt;/div&gt;
        &lt;div id="GHI"&gt;
            The text &lt;a title="Some link" href="linkk"&gt;ABCD&lt;/a&gt; to be replaced
        &lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>Using the Java script  need to get the out put as</p>

<p>Output:   </p>

<pre><code>   &lt;a title="Google" href="http://google.com"&gt;

    The text &lt;a title="Some link" href="linkk"&gt;ABCD&lt;/a&gt;to be replaced

   &lt;/a&gt;
</code></pre>

<p>Rule:</p>

<pre><code>    For every  &lt;div id="ABC"&gt; content inside the &lt;div id="DEF"&gt; need to be replaced with the content of  &lt;div id="GHI"&gt;.
</code></pre>

<p>Thank you</p>
