I'm a beginner in web development and still learning HTML, CSS, and JS. I tried following a YouTube tutorial to create a collapsible sidebar, but for some reason it's collapsed by default and I can't figure out how to make it open. It seems like I don't fully understand what's happening in my code. Can someone please help me identify the issue and explain how this should work?
HTML:
<div id="wrapper">
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li>
<a href="#selectGameSubmenu" data-toggle="collapse" aria-expanded="true" class="dropdown-toggle">
<i class="fa fa-fw fa-gamepad"></i> Select something</a>
<ul class="collapse list-unstyled">
<li>
<a href="#">Link1</a>
</li>
<li>
<a href="#">Link2</a>
</li>
<li>
<a href="#">Link3</a>
</li>
</ul>
</li>
<li>
....(Code continues)
CSS:
#sidebar-wrapper{
z-index: 1;
position: fixed;
...(Code Continues)
JS:
$("#menu-toggle").click(function(e){
e.preventDefault();
$("#wrapper").toggleClass("menuDisplayed");
});