--- title: Element::getAttributeNS --- Element::getAttributeNS — Returns value of attribute ## Description ## ```php public Element::getAttribute ( string|null $namespace , string $localName ) : string|null ``` Gets the value of the attribute in namespace `namespace` with local name `localName` for the current node. ## Parameters ##
namespace
The namespace URI.
localName
The local name of the attribute.
## Return Values ## Returns a string on success or null if no attribute with the given `localName` and `namespace` is found. `\DOMElement::getAttribute` returns an empty string on failure which is incorrect in newer versions of the DOM.