Name
type — NN 3 IE 4 DOM 1
Synopsis
Read-only
Returns the type of form control element. The value is returned in
lowercase letters. You may have to cycle through all form elements in
search of specific types to do some processing on (e.g., emptying all
form controls of type "text"
, leaving other
controls untouched).
Example
if (document.forms[0].elements[3].type == "submit") { ... }
Value
Any of the following constants (as a string):
button
| checkbox
|
file
| hidden
|
image
| password
|
radio
| reset
|
select-multiple
| select-one
|
submit
| text
|
textarea
.
Default
submit
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.