值
一个数字,包含映射中对象的数量
示例
html
<pre class="foo" id="bar" contenteditable></pre>
js
const pre = document.querySelector("pre");
const attrMap = pre.attributes;
pre.textContent = `The 'test' attribute contains ${attrMap.length} attributes.\n`;
规范
规范 |
---|
DOM # dom-namednodemap-length |
浏览器兼容性
加载中…