I’m trying to get all select elements in a given div, even though they have different class names. It looks like this:
<div id="mydiv">
<select class="myclass">...</select>
<select class="myotherclass">...</select>
</div>
I’d like to get all the selects with myclass or myotherclass. I’ve tried several ways but can’t get it right.
I’ve tried variations of the following:
$.each($('[#mydiv select.myclass][#mydiv select.myotherclass]'), function(){ // handle stuff
$.each($('#mydiv select.myclass select.myotherclass'), function(){ // handle stuff
$.each($('#mydiv select.myclass myotherclass'), function(){ // handle stuff
and others, but I can’t seem to get both selects into my element selection.
Perhaps