Note: The [MDN docs for this function](https://developer.mozilla.org/en-US/docs/Web/API/Element.insertAdjacentHTML) state that `beforebegin` and `afterend` only work when the node is in the DOM tree and has a parent, which is not true in this case -- if I try to use your app in Firefox, it throws a strange error. I'm not sure if this is a case where Firefox just doesn't fully support the standard, or Chrome has added extra behavior that defies the standard.