XHTML valid way to replace text with jquery
<p>I have the following code</p>

<pre><code>$("#FOO").hover(function() {
    $(this).html('&lt;p&gt;&lt;a href="somepage.php" target="_self"&gt;first text&lt;/a&gt;&lt;/p&gt;');
    }, function() {
    $(this).html('&lt;p&gt;&lt;a href="somepage.php" target="_self"&gt;hovered text&lt;/a&gt;&lt;/p&gt;');
});
</code></pre>

<p>Is it improper to put <code>&lt;p&gt;</code> &amp; <code>&lt;a&gt;</code> tags in the .html function? It is invalid XHTML and I'd like to make it cleaner.
thanks!</p>

<p>from w3c validator:
Error Line 134, Column 83: end tag for element "A" which is not open</p>

<p>the next error is "end tag for element "p" wich is not open. its just reading those tags weird.</p>

<p><code>….html('&lt;p&gt;&lt;a href="somepage.php" target="_self"&gt;first text&lt;/a&gt;&lt;/p&gt;')</code>;</p>
