How do you show an element after the user clicks on an individual element on the page using jQuery?
I created a side menu with the following HTML:
<li id="navicon"> <a href="" class="nav"> <img src ="/assets/navicon-round.svg/" /> </a> </li> <ul class="side-categories"> <li><a href="">CSS</li></a> <li><a href="">HTML</li></a> <li><a href="">JS/Jquery</li></a> <li><a href="">Miscellaneous</li></a> </ul>
I set .side-categories to display:none
Now I want to show .side-categories when I #nav
I just started learning jQuery, and that is what I came up with. However, it does not work. I hope someone tells me what I did wrong.
$( document ).ready(function() { $('#nav').on('click')event(function()) { event(showNavBar); $('.side-categories').show(); }); });
source share