Your Search Results


    removeItemAt( index )
    Return type: element
    Removes the child item in the element at the specified index. The method returns the removed item.
    <script language="javascript">
    function removeSelectedItem(){
        var myListBox = document.getElementById('myListBox');
        if(myListBox.selectedIndex == -1){
            return; // no item selected so return
    function removeAllItems(){
        var myListBox = document.getElementById('myListBox');
        var count = myListBox.itemCount;
        while(count-- > 0){
    <button label="Remove selected item" oncommand="removeSelectedItem()"/>
    <button label="Remove all items" oncommand="removeAllItems()"/>
    <listbox id="myListBox">
      <listitem label="Alpha"/>
      <listitem label="Beta"/>
      <listitem label="Oscar"/>
      <listitem label="Foxtrot"/>

    See also

    Document Tags and Contributors

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