When you use background
to set img.
You can change the img by class
<img class=".png" style="background: url('test.png');">
.png{
background: url('test2.png');
}
However when use src
, is it possible to change the img by class?
<img src="test.png">
I think it is possible to change src
by javascript, but if I can sort the things by class it is better to handle.
Is it possible?