How to add an element after a DOM element in JavaScript?
Originally posted here!
To insert a text or an element after an element, we can use the after() method in the element object in JavaScript.
Let's say we have a HTML structure like this with a div tag and 2 paragraph tags inside it,
<div>
<p id="pa...
melvingeorge-me.hashnode.dev3 min read