Easy Tutorial
❮ Prop Datetime Autofocus Jsref Getcomputedstyle ❯

Input Text type Attribute

Input Text Object

Example

Check the type of form element the text field belongs to:

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

x output result is:

text

Definition and Usage

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

For text fields, this attribute always returns "text".


Browser Support

All major browsers support the type attribute.


Syntax

Return Value

Type Description
String The form element type of the text field
❮ Prop Datetime Autofocus Jsref Getcomputedstyle ❯