Revert the previous click after detecting a new click on an image file

I have 3 images (A,B,C) in a table. Each cell is overlap with a default image. When I press on the default image, it will display A. When I press on another default image, it will display B and revert back the default image on A. What method can I use?

2nd Mar 2020, 12:39 AM
3 Answers
+ 3
Please show your code here so that we can help you https://www.sololearn.com/post/75089/?ref=app
2nd Mar 2020, 1:06 AM
Gordon - avatar
+ 1
SWL I think. This is about css not about js. A { position : absolute; z-index : -1; } default image:hover { opacity :0; }
2nd Mar 2020, 3:38 AM
🇮🇳Vivek🇮🇳 - avatar
+ 1
Create a click event, In the event function, firstly reset all img to default image, then set the selected image to destined image. https://code.sololearn.com/W0MJIYm1xYKQ/?ref=app
6th Mar 2020, 5:13 AM
Calviղ - avatar