Jquery finding firrt element of specific class
<p>I am using jquery to find a first element having a class "error" applied to it using the below code</p>

<pre><code>$('#mainDiv input.error:eq(0)')
</code></pre>

<p>But the above one working only for input elements only.
How to make this one to work for both input and select elements?</p>
