dom文本全选,全不选
案例1:
<input type="checkbox" name= "" id="ck" value ="" />全选
<input type="checkbox" name= "" class="cklist" value ="" />北京
<input type="checkbox" name= "" class="cklist" value ="" />上海
<input type="checkbox" name= "" class="cklist" value ="" />广州
<input type="checkbox" name= "" class="cklist" value ="" />重庆
<input type="checkbox" name= "" class="cklist" value ="" />厦门
<spript type="text/javascript">
var ck = document.getElementById("ck")
var cklist = document.getElementById("cklist")
ck.onlick = function(){
if(ck.checked == true){
for(var i = 0;i < cklist.length;i++){
cklist[i].checked = true
}
}else{
for(var i = 0;i < cklist.length;i++){
cklist[i].checked = false
}
案例2:
<input type="radio" name=" " checked="checked" id=" " value=" " />男
<select name=" ">
<option value=" ">1</option>
<option value=" ">2</option>
<option value=" " selectes="selected">3</option>
<option value=" ">4</option>
</select>