| focus() | ใช้กำหนดให้ checkbox ได้รับ focus |
|---|---|
| blur() | ใช้กำหนดให้ checkbox สูญเสีย focus |
| click() | ใช้กำหนดให้ เหมือนมีการ click ที่ checkbox |
| name | ใช้ในการกำหนดค่า หรือคืนค่า name ของ checkbox |
| id | ใช้ในการกำหนดค่า หรือคืนค่า id ของ checkbox |
| type | ใช้ในการกำหนดค่า หรือคืนค่า type ของ checkbox |
| value | ใช้ในการกำหนดค่า หรือคืนค่า value ของ checkbox |
| form | ใช้คืนค่า form element ของ checkbox |
| checked | ใช้ในการตรวจสอบ หรือกำหนดค่า ว่ามีการ check ที่ checkbox หรือไม่ |
| defaultChecked | ใช้ในการตรวจสอบ หรือกำหนดค่า default checked ของ checkbox |
| readOnly | ใช้ตรวจสอบ หรือกำหนดว่า checkbox ใช้อ่านอย่างเดียวใช่หรือไม่ คือไม่สามารถเปลี่ยนแปลงข้อมูลภายในได้ |
| tabIndex | ใช้ในการกำหนดค่า หรือคืนค่า ลำดับการได้รับ focus ของ checkbox เมื่อกดปุ่ม tab |
| accessKey | ใช้ในการกำหนดค่า หรือคืนค่า คีย์ลัด ( จากการกดปุ่ม alt + key ) |
| disabled | ใช้ตรวจสอบ หรือกำหนดค่า ว่าจะให้ checkbox นี้ทำงานหรือไม่ |
| accept | ใช้กำหนดค่า หรือคืนค่า ชนิดของเนื้อหาที่จะส่งไป server |
| align | ใช้กำหนดค่า หรือคืนค่า ตำแหน่งข้อความ ของ checkbox |
| alt | ใช้กำหนดค่า หรือคืนค่า ข้อความที่ใช้แสดง ในกรณีที่ browser ไม่สนับสนุน object นี้ |
| onfocus | ใช้กำหนดให้ function ทำงานเมื่อ checkbox ได้รับ focus |
| onblur | ใช้กำหนดให้ function ทำงานเมื่อ checkbox สูญเสีย focus |
| onclick | ใช้กำหนดให้ function ทำงานเมื่อ checkbox ถูก click |
| onmousedown | ใช้กำหนดให้ function ทำงานเมื่อ มีการคลิกเมาส์ลงที่ checkbox |
| onmouseup | ใช้กำหนดให้ function ทำงานเมื่อ มีการปล่อยเมาส์ที่คลิกลง checkbox |
method:focus ();
return type:void
content:ใช้กำหนดให้ checkbox ได้รับ focus
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.focus();
method:blur ();
return type:void
content:ใช้กำหนดให้ checkbox สูญเสีย focus
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.blur();
method:click ();
return type:void
content:ใช้กำหนดให้ เหมือนมีการ click ที่ checkbox
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.click();
property:name;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า name ของ checkbox
example:var tagCheckbox = document.getElementById ( "bamboo" ); alert ( tagCheckbox.name );
property:id;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า id ของ checkbox
example:var tagCheckbox = document.getElementById ( "bamboo" ); alert ( tagCheckbox.id );
property:type;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า type ของ checkbox
example:var tagCheckbox = document.getElementById ( "bamboo" ); alert ( tagCheckbox.type );
property:value;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า value ของ checkbox
example:var tagCheckbox = document.getElementById ( "bamboo" ); alert ( tagCheckbox.value );
property:form;
return type:form
content:ใช้คืนค่า form element ของ checkbox
example:var tagCheckbox = document.getElementById ( "bamboo" ); alert ( tagCheckbox.form );
property:checked;
return type:boolean, void
content:ใช้ในการตรวจสอบ หรือกำหนดค่า ว่ามีการ check ที่ checkbox หรือไม่
example:var tagCheckbox = document.getElementById ( "bamboo" ); if ( tagCheckbox.checked ) { alert ( "checkbox be checked" ); }
property:defaultChecked;
return type:boolean, void
content:ใช้ในการตรวจสอบ หรือกำหนดค่า default checked ของ checkbox
example:var tagCheckbox = document.getElementById ( "bamboo" ); if ( tagCheckbox.defaultChecked ) { alert ( "checkbox be checked by default" ); }
property:readOnly;
return type:boolean, void
content:ใช้ตรวจสอบ หรือกำหนดว่า checkbox ใช้อ่านอย่างเดียวใช่หรือไม่ คือไม่สามารถเปลี่ยนแปลงข้อมูลภายในได้
example:var tagCheckbox = document.getElementById ( "bamboo" ); if ( tagCheckbox.readOnly ) { alert ( "can not change data in checkbox" ); }
property:tabIndex;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า ลำดับการได้รับ focus ของ checkbox เมื่อกดปุ่ม tab
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.tagIndex = "5";
property:accessKey;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า คีย์ลัด ( จากการกดปุ่ม alt + key )
example:var tagCheckbox = document.getElementById ( "bamboo" ); alert ( tagCheckbox.accessKey );
property:disabled;
return type:boolean, void
content:ใช้ตรวจสอบ หรือกำหนดค่า ว่าจะให้ checkbox นี้ทำงานหรือไม่
example:var tagCheckbox = document.getElementById ( "bamboo" ); if ( tagCheckbox.disabled ) { alert ( "checkbox is not enabled" ); }
property:accept;
return type:string, void
content:ใช้กำหนดค่า หรือคืนค่า ชนิดของเนื้อหาที่จะส่งไป server
example:var tagCheckbox = document.getElementById ( "bamboo" ); alert ( tagCheckbox.accept );
property:align;
return type:string, void
content:ใช้กำหนดค่า หรือคืนค่า ตำแหน่งข้อความ ของ checkbox โดยค่าข้อมูลที่เป็นไปได้ คือ right, left, center
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.align = "right";
property:alt;
return type:string, void
content:ใช้กำหนดค่า หรือคืนค่า ข้อความที่ใช้แสดง ในกรณีที่ browser ไม่สนับสนุน object นี้
example:var tagCheckbox = document.getElementById ( "bamboo" ); alert ( tagCheckbox.alt );
property:onfocus = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ checkbox ได้รับ focus
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.onfocus = function() { alert ( "checkbox gain focus" ); }
property:onblur = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ checkbox สูญเสีย focus
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.onblur = function() { alert ( "checkbox loss focus" ); }
property:onclick = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ checkbox ถูก click
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.onclick = function() { alert ( "checkbox be clicked" ); }
property:onmousedown = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ มีการคลิกเมาส์ลงที่ checkbox
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.onmousedown = function() { alert ( "checkbox be mouse clicked" ); }
property:onmouseup = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ มีการปล่อยเมาส์ที่คลิกลง checkbox
example:var tagCheckbox = document.getElementById ( "bamboo" ); tagCheckbox.onmouseup = function() { alert ( "checkbox be clicked mouse release" ); }