HTML DOM type Property
Complete Text Object Reference
Definition and Usage
The type property returns the type of form element. For a text field this will always be "text".
Syntax
Example
The following example returns which type of form element the text field is:
<html>
<body>
<form>
<input type="text" id="text1" />
</form>
<script type="text/javascript">
x=document.getElementById("text1");
document.write("Form element type is: ");
document.write(x.type);
</script>
</body>
</html>
|
Try-It-Yourself Demos
Get the
type of form element (text field)
Complete Text Object Reference
|