Mozilla.com

目次
  1. 1.
  2. 2. 参照
目次
  1. 1.
  2. 2. 参照
« XUL リファレンス HOME
appendItem( label, value )
戻り値の型: 要素
新しい項目を生成し、既存の項目リストの末尾に追加します。値の設定は任意です。この関数は新しく生成された要素を返します。

<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>
言語

このページは2008年 9月 3日, 14:23に更新されました by Marsf

ファイル (0)