Input Text typeProperty
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
![]()
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 Object Other Extensions