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 GMT

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