MULTIPLE Attribute | multiple Property

DHTML, HTML, & CSS

MULTIPLE Attribute | multiple Property


Sets or retrieves whether multiple items can be selected from a list.

Syntax

HTML<SELECT MULTIPLE ... >
Scriptingselect.multiple [ = bMultiple ]

Possible Values

bMultiple Boolean that specifies one of the following values:
falseMultiple items cannot be selected.
trueMultiple items can be selected.

The property is read/write with a default value of false.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Example

This example uses the MULTIPLE attribute and the multiple property to switch between allowing the user to select one item or multiple items from a list.

Sample Code

<SELECT ID=oSelect MULTIPLE>
<OPTION>Item 1</OPTION>
<OPTION>Item 2</OPTION>
<OPTION>Item 3</OPTION>
</SELECT>
:
<BUTTON onclick="oSelect.multiple=false">One</BUTTON>
<BUTTON onclick="oSelect.multiple=true">Many</BUTTON>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.

SELECT


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.