Check out example codes for "htmladjacent". It will help you in understanding the concepts better.

Code Example 1

// <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>

Learn ReactJs, React Native from akashmittal.com