JavaScript - Converting a JavaScript string to a html object
Table of Contents
#
JavaScript - Converting a JavaScript string to a html object
var str = '<div id="myDiv"></div>';
var htmlObject = document.createElement('div');
htmlObject.innerHTML = str;
/* htnkObject is obj;
<div>
<div id="myDiv"></div>
</div>
*/