| focus() | ใช้กำหนดให้ button ได้รับ focus |
|---|---|
| blur() | ใช้กำหนดให้ button สูญเสีย focus |
| click() | ใช้กำหนดให้ เหมือนมีการ click ที่ button |
| name | ใช้ในการกำหนดค่า หรือคืนค่า name ของ button |
| id | ใช้ในการกำหนดค่า หรือคืนค่า id ของ button |
| type | ใช้ในการกำหนดค่า หรือคืนค่า type ของ button |
| value | ใช้ในการกำหนดค่า หรือคืนค่า value ของ button |
| form | ใช้คืนค่า form element ของ button |
| tabIndex | ใช้ในการกำหนดค่า หรือคืนค่า ลำดับการได้รับ focus ของ button เมื่อกดปุ่ม tab |
| accessKey | ใช้ในการกำหนดค่า หรือคืนค่า คีย์ลัด ( จากการกดปุ่ม alt + key ) |
| disabled | ใช้ตรวจสอบ หรือกำหนดค่า ว่าจะให้ button นี้ทำงานหรือไม่ |
| onfocus | ใช้กำหนดให้ function ทำงานเมื่อ button ได้รับ focus |
| onblur | ใช้กำหนดให้ function ทำงานเมื่อ button สูญเสีย focus |
| onclick | ใช้กำหนดให้ function ทำงานเมื่อ button ถูก click |
| onmousedown | ใช้กำหนดให้ function ทำงานเมื่อ มีการคลิกลงบน button |
| onmouseup | ใช้กำหนดให้ function ทำงานเมื่อ มีการปล่อยเมาส์ที่คลิกลงบน button |
method:focus ();
return type:void
content:ใช้กำหนดให้ button ได้รับ focus
example:var tagButton = document.getElementById ( "bamboo" ); tagButton.focus();
method:blur ();
return type:void
content:ใช้กำหนดให้ button สูญเสีย focus
example:var tagButton = document.getElementById ( "bamboo" ); tagButton.blur();
method:click ();
return type:void
content:ใช้กำหนดให้ เหมือนมีการ click ที่ button
example:var tagButton = document.getElementById ( "bamboo" ); tagButton.click();
property:name;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า name ของ button
example:var tagButton = document.getElementById ( "bamboo" ); alert ( tagButton.name );
property:id;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า id ของ button
example:var tagButton = document.getElementById ( "bamboo" ); alert ( tagButton.id );
property:type;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า type ของ button
example:var tagButton = document.getElementById ( "bamboo" ); alert ( tagButton.type );
property:value;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า value ของ button
example:var tagButton = document.getElementById ( "bamboo" ); alert ( tagButton.value );
property:form;
return type:form
content:ใช้คืนค่า form element ของ button
example:var tagButton = document.getElementById ( "bamboo" ); alert ( tagButton.form );
property:tabIndex;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า ลำดับการได้รับ focus ของ button เมื่อกดปุ่ม tab
example:var tagButton = document.getElementById ( "bamboo" ); tagButton.tagIndex = "5";
property:accessKey;
return type:string, void
content:ใช้ในการกำหนดค่า หรือคืนค่า คีย์ลัด ( จากการกดปุ่ม alt + key )
example:var tagButton = document.getElementById ( "bamboo" ); alert ( tagButton.accessKey );
property:disabled;
return type:boolean, void
content:ใช้ตรวจสอบ หรือกำหนดค่า ว่าจะให้ button นี้ทำงานหรือไม่
example:var tagButton = document.getElementById ( "bamboo" ); if ( tagButton.disabled ) { alert ( "button is not enabled" ); }
property:onfocus = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ button ได้รับ focus
example:var tagButton = document.getElementById ( "bamboo" ); tagButton.onfocus = function() { alert ( "button gain focus" ); }
property:onblur = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ button สูญเสีย focus
example:var tagButton = document.getElementById ( "bamboo" ); tagButton.onblur = function() { alert ( "button loss focus" ); }
property:onclick = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ button ถูก click
example:var tagButton = document.getElementById ( "bamboo" ); tagButton.onclick = function() { alert ( "button be clicked" ); }
property:onmousedown = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ มีการคลิกลงบน button
example:var tagButton = document.getElementById ( "bamboo" ); tagButton.onmousedown = function() { alert ( "button be mouse downed" ); }
property:onmouseup = function;
return type:void
content:ใช้กำหนดให้ function ทำงานเมื่อ มีการปล่อยเมาส์ที่คลิกลงบน button
example:var tagButton = document.getElementById ( "bamboo" ); tagButton.onmouseup = function() { alert ( "button be mouse uped" ); }