<select name="d1">
<option value="dd">111</option>
<option value="dd">111111</option>
</select>
<select name="d2">
<option value="dd">2222</option>
<option value="dd">222222222222</option>
</select>
i have two select how two use jquery select this two
$("select[name='d1']").change(function(){xxx});
this code only could select one element,any one could give a hand,thanks
There are several options.
Select all select elements on the page:
Select only those select elements contained within a form having the ID
formD:Select only those select elements in class
d(add aclassHTML attribute to each select element):Select only those select elements whose names/IDs begin with
d:Select only those select elements specifically named by ID (add an
idHTML attribute to each select element):Select only those select elements specifically named using the
nameattribute (which I would try to avoid because it is less readable):