Here is my suggestion to add HTML code to the div element:
<div id="container"></div>
JS code that uses insertAdjacentHTML :
document.getElementById('container').insertAdjacentHTML('beforeend', '<div id="idChild"> content html </div>');
And here is a small performance comparison - (2018.07.02) MacOs High Sierra 10.13.3 on Chrome 67.0.3396.99 (64-bit), Safari 11.0.3 (13604.5.6), Firefox 59.0.2 (64-bit):

As we can see, insertAdjacentHTML is faster (Safari 117M operations per second, Chrome 69M, Firefox 39M), so simple javascript is faster than jQuery (in all browsers). innerHTML +=... slower than jQuery for all browsers.
Here you can perform testing on your computer / browser: https://jsperf.com/insert-html-to-div
Kamil KieΕczewski Jul 02 '18 at 16:25 2018-07-02 16:25
source share