Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.
appendItem( label, value )
Return type: element
Creates a new item and adds it to the end of the existing list of items. You may optionally set a value. The function returns the newly created element.

Example

<script language="javascript">
function addItemsToList(){
	var list = document.getElementById('myMenuList');

	// add item with just the label
	list.appendItem('One');

	// add item with label and value
	list.appendItem('Two', 999);

	// Select the first item
	list.selectedIndex = 0;
}
</script>

<button label="Add items" oncommand="addItemsToList()"/>
<menulist id="myMenuList">
  <menupopup/>
</menulist>

See also

Document Tags and Contributors

 Contributors to this page: Sheppy, ethertank, trevorh, Marsf, Enn, Mgjbot, MarkFinkle, Ptak82, Pmash, Dria
 Last updated by: Sheppy,