我想要得到一个使用javascript或jquery的div中包含的所有单选按钮的列表。如何获得包含在一个div中的单选按钮的ID
例如
<div id="container">
<input type="radio" id="1">
<input type="radio" id="2">
<input type="radio" id="3">
.... //total no of radio buttons are not known
</div>
我想含有包含在DIV所有单选按钮的ID的数组。
arr[0]="1"
arr[1]="2"
arr[2]="3"
...
..
http://api.jquery.com/map/中的第一个示例完成了您所要求的操作,您只需要适当地更改选择器即可。 – 2010-07-22 06:28:38