Reputation: 7291
I am working in an ASP.Net MVC 4 application. In a view, i have multiple html select controls with different class name in a form tag. Currently, i'm getting those as follows-
$('select', form).each(function () {
});
But, i would like to catch select element with their class name also. Here is a pseudocode-
$(select which has classA in form).each(function () {
});
What is the way to do it?
Upvotes: 0
Views: 157
Reputation: 10896
try something like this
$(#form_id select.myclass).each(function () {
});
HTML CODE
<form id="form_id">
<select class="myclass">
<option>A</option>
....
</select>
</form>
Upvotes: 1