I've made a responsive menu with a button. I've made a Javascript function which when I click on the button, the menu appears, but I want it to open when I click on the menu, and when I click on the icon again, it should close the menu.
Because now when I click the menu it stays opened.
Javascript
document.getElementById('menuIcon').addEventListener('click',function(){
document.getElementById('rightMenu').style.display = 'block';
});