1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | < 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 ทั้งหมด
เขียนเมื่อ 16 ปีก่อน โดย Ninenik Narkdeeเลือก checkbox ทั้งหมด
คำสั่ง การ กำหนด รูปแบบ ตัวอย่าง เทคนิค ลูกเล่น การประยุกต์ การใช้งาน เกี่ยวกับ เลือก checkbox ทั้งหมด
ดูแล้ว 19,294 ครั้ง
โค้ดตัวอย่าง
กด Like หรือ Share เป็นกำลังใจ ให้มีบทความใหม่ๆ เรื่อยๆ น่ะครับ

URL สำหรับอ้างอิง
ขอบคุณทุกการสนับสนุน
![]()