<div class="testClass">
<div>
<select name="specialName123">
</select>
</div>
</div>
<div class="testClass">
<div>
<span id="someSpan">
<select name="specialName123">
</select>
</span>
</div>
</div>
How do I select the two above divs on my page based on the fact that they have the class “testClass” and have a select that has “123” in it’s name?
I understand I can find all selects like so $('select[name*="123"]'), and I can use $(".testClass") to select the appropriate divs. But how do I put these together in the way I need to?
You can use
closestmethod:DEMO
or:
DEMO