Re: removeNamedItem vs removeAttribute

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