NamedNodeMap.getNamedItem()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

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

语法

myAttr = attrs.getNamedItem(name)

参数

  • name 是期望获取的属性名

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
getNamedItem

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support