Variable as jQuery selector focus
<p>I'm using JavaScript to copy a specific div from a page into a new page.  I need to remove the ID attributes for each table in the new page.</p>

<p>It seems that since I'm copying content from the first page, I can filter out the IDs from the string before it is written to the second page.  Can jQuery take a variable as its 'focus'?  Instead of manipulating the entire DOM, manipulate a particular string?</p>

<p>I have a non-working version of what I'm talking about:</p>

<pre><code>var currentContent =  window.open('','currentContentWindow');
var htmlToCopy = '&lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body&gt;' + window.frames[0].document.getElementById('PageContentPane').innerHTML + '&lt;/body&gt;&lt;/html&gt;';

        $("table", htmlToCopy).removeAttr('id');

        currentContent.document.open();
        currentContent.document.write(htmlToCopy);
        currentContent.document.close();
</code></pre>
