I'm not very familiar with Bootstrap and I came across this code online that involves javascript in html, which I don't fully understand. I want to make the hamburger menu close automatically after selecting an item in the navigation bar, especially on mobile.
Is there anyone who can assist me with this?
GitHub page
<!-- Page Navbar -->
<nav class="custom-navbar" data-spy="affix" data-offset-top="20">
<div class="container">
<a class="logo" href="index.html">Portfolio</a>
<ul class="nav">
<li class="item">
<a class="link" href="#home">Home</a>
</li>
<li class="item">
<a class="link" href="#about">About</a>
</li>
<li class="item">
<a class="link" href="#portfolio">Portfolio</a>
</li>
<li class="item">
<a class="link" href="#testmonial">Testimonial</a>
</li>
<li class="item">
<a class="link" href="#blog">Blog</a>
</li>
<li class="item">
<a class="link" href="#contact">Contact</a>
</li>
<li class="item ml-md-3">
<a href="components.html" class="btn btn-primary">Components</a>
</li>
</ul>
<a href="javascript:void(0)" id="nav-toggle" class="hamburger hamburger--elastic">
<div class="hamburger-box">
<div class="hamburger-inner"></div>
</div>
</a>
</div>
</nav><!-- End of Page Navbar -->