<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title></title>
<script language="javascript">
function chk_all(){
var x=document.getElementsByTagName("input");
for(i=0;i<=x.length;i++){
if(x[i].type=="checkbox"){
x[i].checked=true;
}
}
}
function unchk_all(){
var x=document.getElementsByTagName("input");
for(i=0;i<=x.length;i++){
if(x[i].type=="checkbox"){
x[i].checked=false;
}
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
select color<br>
<input name="color1" type="checkbox" id="color1" value="red">
red<br>
<input name="color2" type="checkbox" id="color2" value="blue">
blue<br>
<input name="color3" type="checkbox" id="color3" value="green">
green
<br>
<a href="javascript:chk_all();">Check All</a>
<a href="javascript:unchk_all();">Uncheck All </a>
</form>
</body>
</html>
เลือกหรือไม่เลือก checkbox ทั้งหมด
เขียนเมื่อ 17 ปีก่อน โดย Ninenik Narkdeecheckbox ทั้งหมด เลือก
คำสั่ง การ กำหนด รูปแบบ ตัวอย่าง เทคนิค ลูกเล่น การประยุกต์ การใช้งาน เกี่ยวกับ checkbox ทั้งหมด เลือก
ดูแล้ว 19,566 ครั้ง
ไปที่
Copy
โค้ดตัวอย่าง
กด Like หรือ Share เป็นกำลังใจ ให้มีบทความใหม่ๆ เรื่อยๆ น่ะครับ
URL สำหรับอ้างอิง
Top
Copy
ขอบคุณทุกการสนับสนุน
![]()