I have an image on my website. I would like when I click it, it show a <div>, and when I click it another time, it hides the <div>.
How can I do this in JavaScript? Should I use jQuery?
I have an image on my website. I would like when I click it,
Share
You can do like this in JQuery:
First click on an element with id
img_idwill show an element with idmydivand second click would hide it.See more info about toggle() function.