Name
remove( ) — NN n/a IE 4 DOM n/a
Synopsis
remove(index)
Deletes an element from the current collection. Simply specify the
zero-based index value of the OPTION element you
wish to remove from the collection belonging to a
SELECT element. The following example deletes the
first item from a SELECT object:
document.forms[1].rockers.options.remove(0)
The process for removing an OPTION element is
entirely different in Navigator. To delete an item, assign
null to the item in the collection. For example,
the Navigator version of the preceding IE example is as follows:
document.forms[1].rockers.options[0] = null
Regardless of the browser-specific process of removing an option from
the SELECT object, the length of the
options array collapses to fill the space.
Returned Value
None.
Parameters
-
index A zero-based integer indicating which item in the collection should be deleted.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access