getElementsByAttributeNS method
Returns a NodeList of all descendant Elements that match the given attribute namespace URI, local name, and attribute value, in the order in which they are encountered in a pre-order traversal of this Document tree.
getElementsByAttributeNS(namespaceURI, localName, value selector)
Parameters
String namespaceURI
The namespace URI of the attribute to retrieve. The value "*" matches all namespaces.
String localName
Specifies the local name of the attribute to match. The value "*" matches all local attribute names.
String value
Specifies the value of the attribute to match.
ATIElementAttributeSelector selector
Specifies how the attribute value should be matched. When selector is 0, the value parameter is ignored. When selector is 1, only the elements that match both the name and the value are included.
Returns
NodeList. A list of matching element nodes.
Throws
DOMException
SYNTAX_ERR: If selector is invalid.
INVALID_CHARACTER_ERR: If localname is namespace qualified.
这对您有帮助吗?