W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Element.removeAttribute() with a non-existent attribute name

From: David Flanagan <david@oreilly.com>
Date: Thu, 26 Jul 2001 16:00:44 -0700
Message-Id: <200107262300.QAA01503@oxymoron.oreilly.com>
To: www-dom@w3.org
Cc: david@oreilly.com

Neither the Level 2 DOM specification, nor the errata of that
specification seem to specify what should happen if you call
Element.removeAttribute() and pass the name of a non-existent attribute.
Since the spec does not say that an exception is thrown in this case,
I'd assume that the call is simply ignored.  On the other hand,
removeAttributeNode() throws an exception if the specified Attr node is
not found, and I wan't to be sure that removeAttribute() was not
intended to do the same thing.

Can anyone confirm that my assumption (i.e. ignore non-existent
attributes) is correct?

Finally, I'd be more comfortable with the spec. if this were formally
clarified for removeAttribute() and removeAttributeNS() in an erratum.

	  David Flanagan
Received on Thursday, 26 July 2001 19:55:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:36:48 UTC