Select.name
JavaScript1.0+, JScript1.0+ Nav2+, IE3+, Opera3+ Syntax
select.name
Description
The name property of an instance of a Select object returns the name of the select box. This property is often accessed via the elements array of a Form object and used to return the name of the select area. It is most useful when there are many forms on a given page, and determining the name helps you determine what function you want to perform.
Example
Listing 7.469 has a single select box and button. The elements array of a Form object is used to retrieve the name and display it in an alert box.
Listing 7.469 Using the name Property to Retrieve the Name of a Select Box
<html> <head> <script language="JavaScript"> <!-- Hide // Display an alert ... |
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.