Hello!
For starters I must say I haven’t used much jQuery. I just tried to swap the class of a span element between opened and closed everytime it is clicked. Can someone tell me what I am doing wrong?
On first click it changes the class from opened to closed and alerts “Closing” but clicks after that does not change anything. The class stays at “closed” and on click keeps alerting the “Closing” like it would trigger the first block always after that.
it does not work as expected anymore, just keeps saying “Opening” and nothing happens. What is going on here?
EDIT: Now this was a stupid user error, ofcourse if I change the condition in the if I need to swap the if and else blocks around so the logic is correct And now that I look at it it is pretty much the same logic as in your example except I didnt use the generic class in it. I blame the FLU