parent
044046e044
commit
980e243124
4 changed files with 17 additions and 3 deletions
@ -0,0 +1,8 @@ |
|||||||
|
export function replaceChildren(parentNode: Element, newChild: Element) { |
||||||
|
if (parentNode.replaceChildren) { |
||||||
|
return parentNode.replaceChildren(newChild); |
||||||
|
} |
||||||
|
|
||||||
|
parentNode.innerHTML = ''; |
||||||
|
parentNode.append(newChild); |
||||||
|
} |
Loading…
Reference in new issue