Add a new element to the collection of
OPTION
elements
for this
SELECT
. This method is the equivalent of the
appendChild
method of the
Node
interface if
the
before
parameter is
null
. It is
equivalent to the
insertBefore
method on the parent of
before
in all other cases.
Parameters:
-
element - The element to add.
-
before - The element to insert before, or
null
for
the tail of the list.
Throws:
-
DOMException - NOT_FOUND_ERR: Raised if
before
is not a descendant of
the
SELECT
element.