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