+ 5
How to use many times onclick function in html
I know use onclick function one time but I don't know how to use onclick function many times in a button please any one tell me.
18 Réponses
+ 43
Hope it helps!
https://code.sololearn.com/W66GF3JtczAu/?ref=app
+ 4
Use addEventListener
https://code.sololearn.com/W5aSVP7L2z4Z/?ref=app
Try to do the assignment in this lesson.
+ 2
`onclick` event is triggered when an element is (duh) clicked. How many times the event is triggered depends on how many times the element is clicked. I think I'm not getting what you mean by using the event handler function many times here, can you elaborate on this idea further?
+ 1
IRON MAN💻
Okay I see the code, can you tell me what you want to do with multiple clicks on that image?
+ 1
What is the problem? I still don't understand what you want here. Don't give me just 'Yes' I don't get it.
BTW sometimes the second image isn't showing up when the image is clicked, but it could be my connection problem.
+ 1
OK then you need some logic - if (img == img1) {show img2} else {show img1}
0
Please send me a code for example.
0
Please
0
I thought you said you know how to use it at least one time? please elaborate on the necessity to run the event handler function multiple times.
Do you have a code related to this question? can you share it in your original question Description above? hopefully more responses can come having a code to review.
(Edited)
0
Ok . Jast a minute
0
Yes
0
Ok I told you in detail
0
I want . I am click on image first time I seen second image .
But I click on second image I want to seen first image.
0
I don't understand what are you saying.
0
Please tell me in detail
0
And try to give me a code example please.
0
You can use jquery