語法
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① |
瀏覽器相容性
載入中…