I am appending li in a ul using the following code:
li
ul
for (var i = 1; i <= len; i++) { li = document.createElement(\'li\');
You can how use replaceChildren() to accomplish this:
replaceChildren()
root.replaceChildren();