getNamedItemNS
Summary
Gets an attribute with a given name and a given namespace.
Method of dom/NamedNodeMapdom/NamedNodeMap
Syntax
var attribute = attributes.getNamedItemNS(/* see parameter list */);
Parameters
namespace
- Data-type
- String
The namespace name of the attribute to get.
name
- Data-type
- String
The local name of the desired attribute within the specified namespace.
Return Value
Returns an object of type DOM NodeDOM Node
The attribute with the name and namespace.
Examples
Create a SVG circle element.
var nsSVG='http://www.w3.org/2000/svg';
var osvgCircleTag=document.createElementNS(nsSVG,'circle');
alert(osvgCircleTag.getNamedItemNS(nsSVG,'r');
Usage
Used to create and manipulate XML and SVG documents.
Related specifications
- DOM Level 3 Core
- Recommendation
Attributions
Mozilla Developer Network : [NamedNodeMap Article]
Microsoft Developer Network: [getNamedItemNS Method Article]