Input Text type 属性

定义和用法

type 属性返回文本字段是哪种类型的表单元素。

For text fields, this property will always return \text"。

Example

Determine which type of form element the text field belongs to:

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

Try it yourself

Syntax

textObject.type

Technical Details

Return value: String, text field form element type.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support