the script only works if it's within the "hamburger" div, and I have no clue why? Why doesn't it work if I have it in the body or in the head? Also, I can't for the life of my have it worke if I export it to a .js file and src it into the HTML. HELP PLEASE? This is my first site and I'm already completely floored by such a simple problem....
<!DOCTYPE html>
<html lang="it" dir="ltr">
<head>
<meta charset="utf-8">
<link href="styles.css" rel="stylesheet"/>
<title>My Azienda Agricola</title>
</head>
<body>
<header>
<nav>
<div class="hamburger">
<script>
let test=document.getElementsByClassName("hamburger");
test[0].style.backgroundColor="blue";
</script>
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
</div>
</nav>
</header>
</body>
</html>