jquery how to use..... addClass().find().text()
<p>Here's the result I want:</p>

<pre><code>&lt;div id="error" class="alert warning"&gt;&lt;span  class="icon"&gt;&lt;/span&gt;text here&lt;/div&gt;
</code></pre>

<p>I tried this:</p>

<pre><code>$('#error').addClass('alert error').find('span').addClass('icon').text('text here');`
</code></pre>

<p>which results in this:</p>

<pre><code>&lt;div id="error" class="alert warning"&gt;&lt;span class="icon"&gt;text here&lt;/span&gt;&lt;/div&gt;
</code></pre>

<p>I also tried this:</p>

<pre><code>$('#error').addClass('alert warning').text('text here').find('span').addClass('icon');
</code></pre>

<p>which results in this:</p>

<pre><code>&lt;div id="error-arch" class="alert warning"&gt;text here&lt;/div&gt;
</code></pre>

<p><strong>What am I doing wrong?</strong></p>
