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 是期望获取的属性名

浏览器兼容性

BCD tables only load in the browser