亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

JavaScrip-—全選

original 2019-03-22 10:55:06 152
abstrait:<!doctype html><html><head><meta charset="utf-8"><title>JavaScrip-—全選</title><style type="text/css">.box{ width:80px; height:150px; border

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>JavaScrip-—全選</title>

<style type="text/css">

.box{ width:80px; height:150px; border: 1px solid #666; border-radius:5px; padding:5px 10px; margin:0px auto; box-shadow:2px 2px 5px #CCC;}

.box div{ border-bottom:1px solid #666; padding-bottom:5px;}

.box input{ margin:5px;}

</style>


<script type="text/javascript">

 function aa(){

var aa,item;

 aa=document.getElementById('aa')

 item=document.getElementsByName("item[]")

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

if(aa.checked){

item[i].checked=true

}else{

      item[i].checked=false}

}

 

 

 }

</script>


</head><body>






<div class="box">

<div> <input type="checkbox" id="aa" onClick="aa()"> <label for="aa">全選</label> </div>

 <input type="checkbox" name="item[]">選項1<br>

 <input type="checkbox" name="item[]">選項2<br>

 <input type="checkbox" name="item[]">選項3<br>

 <input type="checkbox" name="item[]">選項4<br>

 <input type="checkbox" name="item[]">選項5<br>



</div>





</body>

</html>

















Professeur correcteur:滅絕師太Temps de correction:2019-03-22 11:31:09
Résumé du professeur:完成 的不錯!全選案例后期使用場景較多,要好好掌握!

Notes de version

Entrées populaires