W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2001

Re: removeNamedItem vs removeAttribute

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Mon, 5 Feb 2001 17:10:43 -0500
To: "Daniel Lobo Veiga" <dveiga@inescporto.pt>
Cc: "DOM" <www-dom@w3.org>
Message-ID: <OF891DE35E.EC6A34B9-ON852569EA.00798672@pok.ibm.com>

Yes, you can use either element.getAttributes().removeNamedItem() or
element.removeAttribute(). Their return values (or exceptions) are as shown
in the spec; if you have a preference about what happens when you ask for
an attribute that doesn't exist,, use the call that gives you the behavior
you prefer. In some DOMs, removeAttribute() may be more efficient.

Remember that there are also namespace-aware versions of both these calls,
which may be a wiser choice for modern applications.

Joe Kesselman  / IBM Research
Received on Monday, 5 February 2001 17:11:26 UTC

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