Good morning everyone,
I'm trying to make a menu which when clicking the "label" label changes the src of the image to another one by way of "check", I explain: My intention is that when I click the icon illuminates me, and when clicking the icon again, I get more grayish (I have these icons in images the two versions) and I only get it to light up but it does not return to the previous state.
function Cambio(){
var id = document.getElementById().getAttribute('id');
switch(id){
case id == "imgJuegos":
if (document.getElementById('imgJuegos').src == 'img/juegos.png'){
document.getElementById('imgJuegos').src ='img/bjuegos.png';
}
if (document.getElementById('imgJuegos').src == 'img/bjuegos.png'){
document.getElementById('imgJuegos').src ='img/juegos.png';
}
}
<label class="label-checkbox item-content obicus" style="margin-left:25%;" onclick="Cambio();">
<input type="checkbox" name="ks-radio" value="Books" >
<div class="item-media">
<img style="height:24px; width:24px;" id="imgDj" src="img/bdj.png" >
</div>
<div class="item-inner">
<div class="item-title"></div>
</div>
</label>