$(".fa-bars").click(function () {
$(".header-nav div > ul").css("display","block");
$(this).removeClass("fa-bars");
$(this).addClass("fa-times");
});
$(".fa-times").click(function () {
$(".header-nav div > ul").css("display","none");
$(this).removeClass("fa-times");
$(this).addClass("fa-bars");
});
this is the html code:
<nav class="header-nav">
<i class="mobile-menu fa fa-bars" aria-hidden="true"></i>
<?php wp_nav_menu([
'theme_location' => 'HeaderMenu'
]); ?>
</nav>
In the above code, when I click on "fa-bars" menu displays as I want to do when I click on "fa-time" , menu not close.
sorry for my English.