NamedNodeMap.getNamedItem()

NamedNodeMap 接口的 NamedNodeMap.getNamedItem() 方法返回对应给定名称的属性,如果没有对应名称的属性则返回 null

语法

myAttr = attrs.getNamedItem(name)

参数

  • name 是期望获取的属性名

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
getNamedItemChrome Full support YesEdge Full support 12Firefox Full support 34IE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 34Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown