Input Text typeProperty

Input Text 对象参考手册Input Text Object

Example

Check which form element type the text field belongs to:

var x = document.getElementById("myText").type;

xThe output result is:

text

Try it »


Definition and Usage

The type property returns the form element type of the text field.

For a text field, this property always returns "text".


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the type property.


Syntax

textObject.type

Return Value

Type Description
String The form element type of the text field.


Input Text 对象参考手册Input Text Object Other Extensions