Submit.type

JavaScript1.1+, JScript1.0+ Nav3+, IE3+, Opera3+ Syntax

							submit.type

Description

The type property of an instance of a Submit object returns the type of the text box. This always returns submit.

Example

Listing 7.489 has a text box and a submit button. When the button is clicked, an alert box is popped up that displays the type property of the submit button.

Listing 7.489 Displaying the type Property in an Alert Box
 <html> <head> <script language="JavaScript1.1"> <!-- Hide // Display an alert box that contains the type of the // submit button. function getType(){ alert("The name of this submit button is " + document.myForm.elements[1].type); } // End hide ---> </script> </head> <body> <form name="myForm"> <input type=TEXT ...

Get Pure JavaScript 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.