<input type="checkbox" value="新浪">新浪<br />
<input type="checkbox" value="新浪">雅虎<br />
<input type="checkbox" value="百度"/>百度<br />
<div id="in_div" style="width:100px; height:100px; background:red; color:" οnclick="getinput()"></div>
<script>
var aa=document.getElementsByTagName("input")
function getinput(){
for(i=0; i<aa.length; i++){
if (aa[i].checked==true){
alert("获取到了") ;
}else {
alert("获取不到") ;
}
}
}
</script>
<input type="checkbox" value="新浪">雅虎<br />
<input type="checkbox" value="百度"/>百度<br />
<div id="in_div" style="width:100px; height:100px; background:red; color:" οnclick="getinput()"></div>
<script>
var aa=document.getElementsByTagName("input")
function getinput(){
for(i=0; i<aa.length; i++){
if (aa[i].checked==true){
alert("获取到了") ;
}else {
alert("获取不到") ;
}
}
}
</script>