How to create button for hide menu

Hello, I want to create a button where to click hide the menu.

hopefully it in script, js or ajax

Thanks