jQuery: How to override pseudo style?
<p>So here's the summary</p>

<p>CSS:</p>

<pre><code>input[type="text"]:focus{background:blue;}
.error{background:red;}
</code></pre>

<p>Javascript:</p>

<pre><code>if(error){ $('#elementid').focus().addClass('error');
</code></pre>

<p>Problem:</p>

<p>The field goes red then goes blue immediately and stays blue when it is
 in focus. </p>

<p>How do I make the 'error' class take precedence, when the javascript executes and the focus goes to the 'elementid' field and not the :focus class.</p>
