Input Text type property
Example
Check which type of form element the text field belongs to:
var x = document.getElementById("myText").type;
x The output 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

All major browsers support the type property
Syntax
textObject
.type
Return Value
| Type | Description |
|---|---|
| String | The form element type of the text field |
The Input Text object