I’m attempting to integrate some java into my website to make a cute little popup sidebar. I’m following tutorials I find to the T and making sure all of my names and paths are right but for some reason, it’s displaying the button but not the menu when I click it. Is javascript just too hard for my teeny tiny toddler brain or is there something wrong with my html?
<body>
<header>
<div class="container">
<div id="branding">
<img src="./img/volture_logo_words.png" alt="logo" width="200" height="200">
</div>
</div>
</header>
<div id="sidepnl" class="sidepanel">
<a href="javascript: void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="services.html">Contact</a>
</div>
<div id="main">
<button class="openbtn" onlick="openNav()">☰</button>
<section id="showcase">
<div class="intro">
<h1>Clean. Professional. Custom.</h1>
<div class="smallertext">
<p>Stand out from the rest with a website that's all you.</p>
</div>
</div>
</section>
<section id="slideshow">
<div class="slideshow-container">
<div class="box">
<img src="./img/html.png"width="200" height="200">
<div class="text">
<h3>HTML5 Markup</h3>
<p>HTML files are short and sweet for fast loading times.</p>
</div>
</div>
<div class="box">
<img src="./img/css.png" width="200" height="200">
<div class="text">
<h3>CSS Styling</h3>
<p>Got a specific look in mind? No idea? Got you covered, either way.</p>
</div>
</div>
<div class="box">
<img src="./img/js.png" width="200" height="200">
<div class="text">
<h3>Javascript Functionality</h3>
<p>Get the results and functionality you need with javascript.</p>
</div>
</div>
<div class="box">
<img src="./img/volture_logo.png" width="200" height="200">
<div class="text">
<h3>Graphic Design</h3>
<p>No assets? No problem.</p>
</div>
</div>
</div>
<footer>
<p>volture web design, 2020</p>
</footer>
<script type="text/javascript" src="js/java.js"></script>
</body>
</html>
HTML, just the body tag. I’ll edit it with the whole thing if need be just didn’t want the post to be too long.
function openNav() {
document.getElementById("sidepnl").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
}
function closeNav() {
document.getElementById("sidepnl").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
}
Java