I have a course work and I had the following idea:
There are several images that will represent the chairs of a cinema (all are the same images, the same are in my HTML file), and I want to make the effect of when the user clicks on one of them it changes color symbolizing that he chose that chair.
I want the "onClick" to be used so that it calls another image when clicking on the images that are appearing for the user or it will call the same image only of different color.
I want it to be by this method but I do not know if it's possible, if not, show me the best way to do it.
My HTML file
<div>
<img src="imagens/cadeiraAzul.png" id="cadeira1" onclick="">
</div>
My JS file
function cor(){
}
As a beginner in this area you will probably have tools unknown to me so if you can explain what each one does, I'll be even more grateful.
I also need if the user clicks again it changes to the image that was initially, in case it is chosen by mistake.