Simon Willison’s Weblog

Subscribe

31st August 2024

whenever you do this: el.innerHTML += HTML

you'd be better off with this: el.insertAdjacentHTML("beforeend", html)

reason being, the latter doesn't trash and re-create/re-stringify what was previously already there

Andreas Giammarchi

This is a quotation collected by Simon Willison, posted on 31st August 2024.