W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2001

DOM2-HTML: HTMLSelectElement.add

From: Thomas Much <thomas@snailshell.de>
Date: Thu, 20 Dec 2001 18:35:07 +0100
To: <www-dom@w3.org>
Message-ID: <B847DF6C.9AEF%thomas@snailshell.de>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:55 GMT