My JS: document.getElementsByClassName('main').style.backgroundColor = '#101521';
My HTML:
<html class= 'main'>
<head>
<meta charset="UTF-8">
<title>Widg-It</title>
</head>
<body>
<span id="close">X</span>
</body>
</html>
Im trying to make the background of my webpage the color '#101521' using CSS DOM
I run the code and I get the error: "cannot set property of 'backgroundColor' of undefined"
I do not know what this means, and how to make it work.