Form.name
JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax
form.name
Description
The name property of the Form object represents the name of the form as specified in the HTML <form> tag.
Example
Listing 7.262 shows how the name property is used to get the HTML NAME attribute of the form. The showName function uses the Form object to access the name attribute of the form.
Listing 7.262 Accessing name Property
<html> <head> <title>Access the name property of the Form object</title> </head> <body> <script language="JavaScript"> <!-- Hide function showName(){ // Alert box tells what the name of the form is alert("Form Name is: " + document.form1.name); } // End Hide ---> </script> <form name ="form1" > Dummy input text box. ... |
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.