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>

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

bye, Thomas

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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC