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