87,907
社区成员
发帖
与我相关
我的任务
分享
<div style="position: static;top: 0px;left: 0px;height: 100;width :100%;padding: 5px;overflow: auto;" onclick="getXxx()">
<input type="checkbox" name="xxx" value="010100">xxx
<input type="checkbox" name="xxx" value="010101">xxx <br>
<input type="checkbox" name="xxx" value="010201">xxx
<input type="checkbox" name="xxx" value="010301">xxx <br>
</div>
<script type="text/javascript">
function getXxx()
{
var arr = [];
var cbox = document.getElementsByTagName("input");
for(var i=0,v,l = cbox.length; v = cbox[i],i<l; i++)
if (v.checked)
arr.push(v.value);
alert(arr);
}
</script>