Jquery---Select all the text box with given class
<p>html </p>

<pre><code>&lt;input type="text" class="required" /&gt;
</code></pre>

<p>now i want to select all the text-box with this given class name and want to check whether particular text box has another class called "error" which i am adding dynamically.</p>

<pre><code> $(".required).each(function() {
     if(this.hasClass('error'){
          alert("has error class");
     }
 }
</code></pre>

<p>but not working as expected.. how to do it?</p>
