jQuery focus on one element, then another immediately after
<p>I'm trying to set focus on one element, then immediately set it back to the previously focused item. Here's the HTML:</p>

<pre><code>&lt;input id="em3" type="email" /&gt;
&lt;p class="error" tabindex="0"&gt;Please fill out the email field&lt;/p&gt;
</code></pre>

<p>I've tried this:</p>

<pre><code>$(this).next('.error').focus();
$(this).prev('input').focus();
</code></pre>

<p>and this:</p>

<pre><code>$(this).next('.error').focus();
setTimeout(function(){
      $(this).prev('input').focus();
}, 2000);
</code></pre>

<p>But neither works. The focus stays on the ".error" element.</p>

<p>Any ideas?</p>