insertAdjacentHTML - DOM - Insert HTML - Add html tag


PHOTO EMBED

Wed Oct 28 2020 08:20:03 GMT+0000 (UTC)

Saved by @julien #javascript #html

<!-- beforebegin -->
<p>
  <!-- afterbegin -->
  foo
  <!-- beforeend -->
</p>
<!-- afterend -->

list.insertAdjacentHTML('beforebegin', myDiv);
content_copyCOPY

https://medium.com/@gemma.stiles/breaking-down-the-dom-dd197e4f7154