I need to find an DropDownList with class addressControlCountry. How?
<div id="myDiv">
<asp:DropDownList runat="server" CssClass="addressControlCountry" />
</div>
This doesn't work
$('#myDiv .addressControlCountry')
I need to find an DropDownList with class addressControlCountry. How?
<div id="myDiv">
<asp:DropDownList runat="server" CssClass="addressControlCountry" />
</div>
This doesn't work
$('#myDiv .addressControlCountry')
Please use this
$('#myDiv > .addressControlCountry')
ancestor descendants didn't work. If the element was the direct child of myDiv, obviously it should have worked already, like it is.$('#myDiv .addressControlCountry') will search for an element having id="myDiv" and class="addressControlCountry" which is not the case. So we have to define that is should look to its descendants for provided class name.$('#myDiv.addressControlCountry') will search for that.