Answers for "js insert html after element"

2

htmladjacent

// <div id="one">one</div>
var d1 = document.getElementById('one');
d1.insertAdjacentHTML('afterend', '<div id="two">two</div>');

// At this point, the new structure is:
// <div id="one">one</div><div id="two">two</div>
Posted by: Guest on February-28-2020

Code answers related to "js insert html after element"

Browse Popular Code Answers by Language