This is the code for an icon that reveals a side menu on my website. Using Jquery to import it into all of my html pages. For some reason the image returns the rror in the title of this post when simply using an img tag. I've never had this problem before and have no clue what to solve it. It's located in the same
<script src="https://kit.fontawesome.com/11ab057999.js" crossorigin="anonymous"></script>
<div class="logo-wrapper">
<!-- UPS LOGO -->
<img id="fix-token-logo" src="fixTokenLogo.png" alt="">
<div id="menu-icon" onclick="">
<i class="fa-solid fa-bars" onclick="activateMenu()"></i>
</div>
</div>
<script>
function activateMenu () {
const sidebar = document.getElementsByClassName('sidenav-wrapper')
sidebar[0].classList.toggle('hidden')
}
</script>
This is included on all of my html files in the head:
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
It seems that the browser cant't find the image, try one of thease steps:
An error that I've see in your HTML and your script, is that is trying to find the "sidenav-wrapper" class, but in your HTML there is no "sidenav-wrapper" class, try to change it to the class that you want to add the class "hidden" Remember: If you want to find the classes "sidenav" and "wrapper" you write "sidenav wrapper" insted "sidenav-wrapper"