DOM2-HTML: HTMLSelectElement.add

Hi,

HTMLSelectElement.add raises a DOMException(NOT_FOUND_ERR) if the "before"
argument is not a descendant of the SELECT element. OK.

But what happens if I try to add an element (passed in the "element"
argument), that is not an OPTION element? Currently, add is directly
delegated to Node.appendChild or Node.insertBefore - that is, I can add
HEAD, IMG, FORM elements to the options array... That makes no sense.

If the standard specifies a special operation for adding OPTIONs, it should
deal with errors specially and raise an exception if an element other than
OPTION is passed.
If you want to create invalid documents you still can use the Node interface
on the SELECT element, but the standard should not make this too ease
IMHO...

bye, Thomas

-- 
http://www.muchsoft.com/inscript/
http://www.icab.de

Received on Thursday, 20 December 2001 12:35:47 UTC