In my replit I am trying to make a function to change the opacity of the navbar when the body loads. I have checked the javascript and HTML multiple times but the devtools says the function is not defined
Relevant HTML
<body onload="setNavbarOpacity()">
<nav>
<ul id="Navbar">
<li><button id="Contact"><a href="Contact.html">Contact Us</a></button></li>
<li><a href=Prices.html class="link">Prices</a></li>
<li><a href=Projects.html class="link">Project</a></li>
</ul>
</nav>
I have have the Javascript linked btw
Relevant JS
function setNavbarOpacity() {
let navbar = document.getElementById("Navbar");
navbar.style.opacity = 1;
}