DocumentFragment: lastElementChild 属性
DocumentFragment.lastElementChild 只读属性返回文档片段的最后一个子 Element,如果没有任何子元素,则返回 null。
值
一个 Element,它是该对象的最后一个子 Element,如果没有,则为 null。
示例
js
let fragment = new DocumentFragment();
fragment.lastElementChild; // null
let paragraph = document.createElement("p");
fragment.appendChild(paragraph);
fragment.lastElementChild; // <p>
规范
| 规范 |
|---|
| DOM # ref-for-dom-parentnode-lastelementchild① |
浏览器兼容性
加载中…