I am using the following code in JavaScript to insert a div with class = "blah" inside a main div with class = "container" (the main div is created with HTML) but something goes wrong.
const board = document.createElement('div');
const mainContainer = document.getElementByClassName('container');
board.className = 'blah';
mainContainer.appendChild(board);
The error I get is "Uncaught TypeError: mainContainer.appendChild is not a function". What am I missing?
Thank You for the help