Is it possible to copy javascript with javascript?
<p>Is it possible to copy javascript with javascript? For example:</p>

<pre><code>&lt;div class="copyThis"&gt;
    &lt;script language="javascript"&gt;
        $(function()
        {
            $("#click").click(function(e){
                $('.copyThis').clone().appendTo('#copyArea');
                e.preventDefault();
            });
        });
    &lt;/script&gt;
     CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
    &lt;div style="width: 200px; height: 50px; background-color: gray;"&gt;
        &lt;a id="click" href=""&gt;click here to copy&lt;/a&gt;
    &lt;/div&gt;
    &lt;div id="copyArea"&gt;
         Put here:
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>But this doesn't copy the  tag and its content. At least, not that I know of.</p>

<p><strong>NOTE:</strong>
I came upon this question in relationship to a different question I had posted here: <a href="http://stackoverflow.com/questions/4453593/infinite-loop-question-is-it-possible-to-make-a-copy-this-code-to-share-with">Infinite-loop question: Is it possible to make a "Copy this code to share", with a "copy this code to share" inside of it?</a>
I hope it's ok to post this question separately as it's sort of a curiosity thing.</p>
