语法
js
remove()
参数
无。
返回值
无(undefined)。
示例
使用 remove()
html
<span>Result: </span>A long string.
js
const span = document.querySelector("span");
const textNode = span.nextSibling;
textNode.remove(); // Removes the text
规范
| 规范 |
|---|
| DOM # ref-for-dom-childnode-remove① |
浏览器兼容性
加载中…