Select.type

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

							select.type

Description

The type property of an instance of a Select object returns the type of the select box. This is either select-multiple, if the multiple attribute is set in the <select> tag, or select-one if it is not.

Example

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

Listing 7.478 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 // select box. function getType(){ alert("The name of this text box is " + document.myForm.elements[0].type); } // End ...

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.