+ 15
How do give specific conditions to different clicks in Jquery??🤔🤔
I want that if i click on a div element it shows a text (for ex. "hi" on first click) and on the other click show another text (Lets say "hello") and other on other clicks on the same element ???
2 ответов
+ 4
I wrote you some codes for your question. See:
https://code.sololearn.com/WLQtT68orFdP/?ref=app
+ 4
A way could be:
With each click:
- increase a counter
- use an array (or a swich-case, or a set of if-elses) with the different messages you want to show, using the counter to determine with of them to choose