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

標簽框的全選和全取消

original 2019-02-09 14:35:55 276
abstrait:<!DOCTYPE html><html><head> <title>switch</title> <style type="text/css"> .box0{width: 100px;height: 200px;;margin:100px auto;border: 1px solid #000} .box

<!DOCTYPE html>

<html>

<head>

<title>switch</title>

<style type="text/css">

.box0{width: 100px;height: 200px;;margin:100px auto;border: 1px solid #000}

.box0 div{margin-bottom: 20px;border-bottom: 1px solid #000}

.box0 input{margin-top: 8px;}

</style>

</head>

<body>

<script type="text/javascript">

function function_checkAll() {

var checkall,item;

checkall=document.getElementById("in")

item=document.getElementsByName("in1")

console.log(item)

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

console.log(item[i])

if (checkall.checked) {item[i].checked=true;}

else{item[i].checked=false;}

}

}

</script>

<div class="box0">

<div>

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

</div>

<input type="checkbox" name="in2" id="in1"><label for "in1">選項1</label><br>

<input type="checkbox" name="in2" id="in1"><label for "in1">選項2</label><br>

<input type="checkbox" name="in2" id="in1"><label for "in1">選項3</label><br>

<input type="checkbox" name="in2" id="in1"><label for "in1">選項4</label><br>

<input type="checkbox" name="in2" id="in1"><label for "in1">選項5</label><br>

<input type="checkbox" name="in2" id="in1"><label for "in1">選項6</label><br>

</div>


</body>

</html>


Professeur correcteur:韋小寶Temps de correction:2019-02-11 10:05:58
Résumé du professeur:寫的很不錯 全選在很多的項目中都可以見到 并且還是比較重要的知識

Notes de version

Entrées populaires