Copy HTML and preserve events
<p>I wish to clone the innerhtml of an element (#clone) and insert it into another element (#newLocation).</p>

<p>The problem with using clone() is that I will have first delete the elements (if any) currently in #newLocation, then iterate over each element in #clone and append it to #newLocation.  Not the end of the world, but hoping for a simpler way.</p>

<p>Instead, I thought I'd use html().  Since this won't preserve events, I would have to delegate the even using ON. I had thought this work work, however, it doesn't.</p>

<p>Any suggestions what I am doing wrong?  Also, think it would be more efficient to use the clone() solution even if I can get html() solution working?</p>

<p>Thanks</p>

<p>EDIT.  Just wrote my very first plugin.http://jsfiddle.net/Wnr65/  Seems to work.  Good idea to use?  Sure it could be written better.  Thanks</p>

<pre><code>$(document).ready(function(){
    $("#cloneIt").click(function(){$('#newLocation').cloneInnerHtml('clone').css('color', 'red');});
    $("#clone a").click(function(){alert("click");});
    $("#clone select").change(function(){alert("change");});
});

(function( $ ){
    $.fn.cloneInnerHtml = function( id ) {
        this.empty();
        var $t=this;
        $('#'+id).each(function() {$t.append($(this).clone(true));});
        return this;
    };
})( jQuery );


&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;title&gt;Clone INNERHTML&lt;/title&gt;
&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js" language="javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;

$(document).ready(function(){
    $("#cloneIt").click(function(){$('#newLocation').html($('#clone').html());});

    //Only works on original clone
    $("#clone a").on("click", function(){alert("click");});
    $("#clone select").on("change", function(){alert("change");});

    //Doesn't work at all
    $("#newLocation a").on("click", function(){alert("click");});
    $("#newLocation select").on("change", function(){alert("change");});

});

&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;input type="button" value="Clone it" id="cloneIt" /&gt;

&lt;p&gt;Original clone is shown below&lt;/p&gt;
&lt;div id="clone"&gt;
&lt;a href="#"&gt;Click Me&lt;/a&gt;
&lt;select&gt;&lt;option&gt;Hello&lt;/option&gt;&lt;option&gt;Goodby&lt;/option&gt;&lt;/select&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;p&gt;Insert new clones below.&lt;/p&gt;
&lt;div id="newLocation"&gt;
&lt;p class="someOldElement"&gt;someOldElement&lt;/p&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
