how can add toggle button using javascript or jquery to show and hide elements in nav bare : I'm a beginner in javascript I want to add hide and show button using toggle methods

       <body>
          <header> 
           <li><a href="#">Mécanique</a>
                <ul class="sub-menu">
                    <li><a href="#">Mécanique du point</a></li>
                    <li><a href="#">Mécanique du solide</a></li>
                 </ul>
            </li>
           
          </header>
        </body>

  