I'm Using jQuery for Toggle in wordPress to change menu icon but its still does not change?

42 Views Asked by At
<script>
jQuery(document).ready(function() {
  jQuery("#toggleMegaMenu").click(function() {
    jQuery(".wpac-mega-menu").slideToggle();
    JQuery("#toggleMegaMenu ").toggleClass('fa-solid fa-caret-up');
  });
});
 </script>

I have applied jQuery to make megamenu toggle, Toggle is work like when I click mega-menu appears but Icon is not change to toggleclass icon when I click on menu button for mega-menu

Here is Video Link Attached. 1

1

There are 1 best solutions below

0
ismamz On

It seems that you're putting JQuery instead of jQuery when you call the toggleClass method.