How can I pass html from textarea into jQuery?
<p>I have the following html snippet.  I am trying to let a user enter some html into the textarea, then I will parse out their style block and do some things with their styles.  How can I pass the html string from the #html textarea into jQuery so I can parse it?</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script src="script/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        function ParseIt() {
            alert($("#html").val());
            $("style", $("#html")).each(function(){ alert($(this).text());});
        }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
        &lt;textarea id="html" name="html" class="email_body " rows="25" cols="100"&gt;&lt;/textarea&gt;
        &lt;br /&gt;
        &lt;input type="button" value="Parse It" onclick="ParseIt();" /&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Have also tried this function with no luck:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function ParseIt() {
        alert('parsing');
        $($("#html").val()).find('style').each(function () {
            alert('found style');
            alert($(this).text());
        });
    }
&lt;/script&gt;
</code></pre>
