Home > Element Reference : Menulist

Contents

### Menulist

An element that can be used for drop-down choice lists. The user may select one of the elements displayed in the menulist. The currently selected choice is displayed on the menulist element. To create the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements.

More information about Menulist

#### Attributes:

Attributes inherited from XUL Element

editable

Indicates that the value of the menulist can be modified by typing directly into the value field. This is rendered as a textbox with a drop-down arrow beside it. The user may enter text into the textbox or select one of the choices by clicking from the drop-down.

#### Properties and Methods:

Properties and Methods inherited from XUL Element

appendItem ( label , value ) Moz0.9.6

Creates a new menuitem element and adds it to the end of the menulist. You may optionally set a value.

insertItemAt ( index, label , value ) Moz0.9.6

Creates a new menuitem element and inserts it at a specific position in the menu. You may optionally set a value.

removeItemAt ( index ) Moz0.9.6

Removes the child item in the menu at the given index.

selectedIndex

Holds the index of the currently selected item in the menu. If no item is currently selected, this will be set to -1. You can select an item by setting this value.

selectedItem

Holds the element of the menu that is currently selected. If no element is currently selected, this will be null. Use selectedIndex to retrieve the position of the element.

Copyright (C) 1999 - 2002 XULPlanet.com