I want to make a simple switch of <img src="..."> depending on the present src with JavaScript. So if the image #plus_1 is clicked, the script should check if the string 'plus' is in the src attribute, and if yes, the src attribute should change.
Not sure what mistake I made, help would be very much appreciated!
JavaScript:
function ek_ak(id) {
var ement = document.getElementById(id);
if (ement.img.src.includes("plus") == true) {
ement.img.src == "minusred.png";}
}
HTML
<img src="plusred.png" id="plus_1" onclick="ek_ak('plus_1')"/>
=vs==ement.img.src = "minusred.png"includesfunction not supported by IE.