Copying a parent element to be displayed in a modal box
<p>I have a link which I want to display a modal dialog box, containing a headline and a copy of the parent element of the clicked link.</p>

<pre><code>$('#link').live('click',function(){
    container = $(this).parents(".container")[0];
    message = $("&lt;h2&gt;You clicked on this.&lt;/h2&gt;" + container);
    message.find(".foo, .bar, .lorem").remove();

    console.log(message[0]);
    // code for displaying the box using message[0]
});
</code></pre>

<p>I also have to filter out certain children of the container element.</p>

<p>However, this (being my fourth attempt at it after dabbling with <code>clone()</code> and <code>insertAfter()</code> for a while) does not work. It only displays the <code>&lt;h2&gt;</code>, with no sight of the copy of the parent element.</p>

<p>Obviously the original parent element still visible on the page behind the modal should not be affected.</p>

<p>What's wrong here?</p>
