I want to open and close my menu with same button. here is my code.
<script>
$('#open-menu').click(function() {
$("#mySidenav").css("width" , "250px");
$("#l_m").css({"marginLeft": "250px", "position" : "absolute", "width" : "100%"});
// $(this).attr('id','close-menu');
});
$('#close-menu').click(function() {
$("#mySidenav").css("width" , "0");
$("#l_m").css("marginLeft" , "0");
});
</script>
Check this fiddle : https://jsfiddle.net/uyjogg5e/10/
(I tried to add the line that is commented but when I click on it, nothing happens)