I need a little help here. I created a header that has bars icon, when ever you click it the icon changes to X.
I simply created a JS code that when ever the user clicks the icon changes to X, then click and it changes back to bars.
Now the code works, but the X doesn’t go back to bars again…so I need help with that if you may?
We would need to see a sample page that demonstrates the problem, to most effectively come up with a solution for you.
Thanks, that helped to confirm my suspicions.
Your addClass/removeClass code is effective for showing the times, but you need the opposite of those to hide the times.
I recommend that you replace addClass and removeClass with toggleClass instead.
here is what I did:
jQuery('.bars > .fa').toggleClass('fa-bars fa-times');
and it’s working
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.