<input type="checkbox" name="ck" value="1" />
<input type="checkbox" name="ck" value="2" />
<input type="checkbox" name="ck" value="3" />
<input type="button" onclick="getcks()" value="getcks" />
<script>
function getcks(){
var arr=new Array();
for (i=0;i<document.all.ck.length;i++){
if (document.all.ck[i].checked==true){
arr.push(document.all.ck[i].value);
}
}
alert(arr);
}
</script>
<input type="checkbox" name="ck" value="2" />
<input type="checkbox" name="ck" value="3" />
<input type="button" onclick="getcks()" value="getcks" />
<script>
function getcks(){
var arr=new Array();
for (i=0;i<document.all.ck.length;i++){
if (document.all.ck[i].checked==true){
arr.push(document.all.ck[i].value);
}
}
alert(arr);
}
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货