javascript SELECT add( )
add( ) | Firefox/Netscape/NN 6 IE 5 Chrome/Safari/DOM 1 |
add(newOptionElement[, positionIndex]) add(newOptionElement, optionElementReference) | |
Adds a new option element to the current select element. Unfortunately, IE and Netscape 6 don't agree on the parameter values for this method. While all browsers require a reference to a newly created option element (the value returned from a document.createElement("option") method is appropriate for that), the second parameter varies with browser. In IE, the second parameter is optional and supplies a numeric index to the existing option element; the new option is inserted in front of that element. With no second parameter, the new option is appended to the existing option elements. In Netscape 6 (which implements the W3C DOM recommendation from the unfinished HTML module), the second parameter is required. The parameter is either a reference to an existing option element (the new option is inserted before that referenced option) or null (the new option is appended to the existing options). |
|
Parameters | |
|
|
Returned Value | |
None. |
Powered by Linode.