If I have a block of HTML with many tags, how do insert it in JavaScript?
var div = document.createElement(\'div\');
div.setAttribute(\'class\', \'post block
Add each line of the code to a variable and then write the variable to your inner HTML. See below:
var div = document.createElement('div');
div.setAttribute('class', 'post block bc2');
var str = "First Line";
str += "Second Line";
str += "So on, all of your lines";
div.innerHTML = str;
document.getElementById('posts').appendChild(div);