国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

js實現(xiàn)全選

Original 2019-06-26 22:24:54 230
abstract:<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>全選</title><style type="text/css&q

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>全選</title>

<style type="text/css">

.box{

height:200px;

width:80px;

border:1px solid #ccc;

border-radius:10px;

padding-left:5px;

}

#checkall{

margin-top:10px;

}

[name]{

margin-top:10px;

}


</style>

</head>


<body>

<script type="text/javascript">

function checkAll(){

var checkall,ite;

checkall=document.getElementById('checkall');

ite=document.getElementsByName('ite');

for(var i=0;i<ite.length;i++){

if(checkall.checked){

ite[i].checked=true;

}else{

ite[i].checked=false;

}}}

</script>

<div class="box">

<div>

<input type="checkbox" id="checkall" onclick="checkAll()" /><label for="checkall">全選</label>

</div>

<input type="checkbox" name="ite" />選項1<br />

<input type="checkbox" name="ite" />選項2<br />

<input type="checkbox" name="ite" />選項3<br />

<input type="checkbox" name="ite" />選項4<br />

<input type="checkbox" name="ite" />選項5<br />

<input type="checkbox" name="ite" />選項6<br />

</div>

</body>

</html>


Correcting teacher:天蓬老師Correction time:2019-06-27 13:10:20
Teacher's summary:全選 的實現(xiàn)方式有很多種, 你這種方案是最普通與常用的

Release Notes

Popular Entries