Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 3

JavaScript Close on Click

Solved! Go to Solution.

Hi ,
I have this nav-bar .
I have managed to make it work on outside click with the help of somebody but I would like it to close after I click on About for example and I have no idea how I should do that.
Keep in mind that I an now to coding and JavaScript is my worse nightmare. :D
Thanks !

2 Replies
Copilot Lvl 2
Message 2 of 3

Re: JavaScript Close on Click

Is this what you meant?


// Handle close bar
const closeNavbar = () => {

// Toggle hamburger animation
const toggleHamburgerBtn = () => {

// Handle change link
const changeLink = () => {
  $('.nav-links a').on('click', () => {



Copilot Lvl 3
Message 3 of 3

Re: JavaScript Close on Click

Yess !! And I understend it too hahah . 

Sorry , I am new to coding and I get excited when I understend stuff :D