Element API.removeAttributeNS only deletes; return is undefined.
Same URI rules. Both need namespace URI + local name.
Choose. Prefer the map when you need to move or inspect the Attr.
Compatibility
Browser Support
NamedNodeMap.removeNamedItemNS() is marked Baseline Widely available on MDN (since July 2015). DOM API — not a Node.js built-in.
✓ Baseline · Widely available
removeNamedItemNS()
Remove namespaced Attr nodes across modern browsers. Pass the namespace URI, not the prefix.
98%Core tag support
Chrome1+
Full support
Edge12+
Full support
Firefox1+
Full support
Safari1+
Full support
Opera✓
Full support
HTML element100% supported
Bottom line: Safe for production. Use removeNamedItemNS(uri, localName) when you need the removed Attr; use removeAttributeNS when you only need to delete.
Frequently Asked Questions
It removes the Attr matching a namespace URI and localName from the map and returns that Attr. Typical use: element.attributes.removeNamedItemNS(uri, "one") on XML or SVG attributes.
No. MDN marks NamedNodeMap.removeNamedItemNS() as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
The namespace URI (full URL string), not the xmlns prefix. MDN warns: namespace is the URI, not the prefix (for example use http://www.example.com/ob, not ob).
The removed Attr node. You can still read localName, value, and namespaceURI after removal.
It throws NotFoundError (DOMException) when no attribute matches the given namespace and local name.
removeNamedItemNS on attributes returns the removed Attr. element.removeAttributeNS(namespace, localName) returns undefined.