How to filter elements in a dynamic element
<p>I'm trying to show a "live" table of contents in a separate div, based on a source textarea. This involves hiding everything but h1,h2,h3,h4,h5,h6 tags. How would I do this? I tried several functions using .show() and .hide() on #toc elements, but it had no effect.</p>

<p>Can you point me in the right direction?</p>

<p>Here's the jQuery I wrote, with my question in comments. This 'working' version is at <a href="http://jsfiddle.net/supertrue/vQvQE/" rel="nofollow">http://jsfiddle.net/supertrue/vQvQE/</a></p>

<pre><code>    // selector for the source textarea
    var textarea = $('textarea#source');
    // selector for the destination
    var destination = $('#toc');

    textarea.keyup(function() {

        destination.html( textarea.val() );

    });

    // now hide everything in #toc except h1,h2,h3,h4,h5,h6
    // How do I do this?
</code></pre>
