HTMLInputElement: type property - Web APIs | MDN
Value
A string representing the type.
Its possible values are listed in the attribute's input types section.
Example
HTML
html
<input id="input1" type="date" />
JavaScript
js
const inputElement = document.querySelector("#input1");
console.log(inputElement.type); // Output: "date"
Specifications
| Specification |
|---|
| HTML # dom-input-type |
Browser compatibility
See also
HTMLTextAreaElement.typepropertyHTMLButtonElement.typeproperty