Hello @surajgond07. Looking at the code that you provided it seems like there’s a typo in the variable name. You’re calling it “collapsible” but you declared it as “collapsibles” in plural. That’s probably your problem.
Hello @surajgond07 , thanks for posting your problem.
Your code to toggle the nav menu above does not work because you are targeting the wrong elements.
Kindly change it to the code below to see if it helps.
@surajgond07 , thanks for the feedback. I noticed my code and @coelmay’s code will work in dev tools. However if you use either my code or @coelmay’s code in your main.js file, the codes will not work on your deployed site because in your HTML you added the script tag twice. Kindly remove the script tag in the footer element.
<div class="footer__brand">
<img src="images/logo.png" alt="">
<p class="footer__copyright">Copyright 2022 Suraj Infotech</p>
</div>
<!-- Remove the script tag below -->
<!-- <script src="js/main.js"></script> -->
</div>
</footer>
<!-- Footer End -->
<script src="js/main.js"></script>
<!-- AOS Animation -->
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
I also noticed your footer has navigation menus. Therefore I edited the original main.js code to also register click events on the footer navigation menus. Your main.js script should now look like the code below.
Hello, @clarnx thanks for your support. the menu and toggle are working now but there is a tiny problem I got now. When I put your JS code the animation and transition effect went with the menu button and toggler.