SyntaxFix
Write A Post
Hire A Developer
Questions
Use querySelector insted of getElementById();
var c = document.querySelector('#mainContent'); c.appendChild(document.createElement('div'));