I have an image of a light switch on my website. It launches a function (using onClick), which makes the entire wrapper div equal to opacity 0.2, which gives the effect of the light off.
Thus, the switch is pressed and the indicators are “off”, however, I cannot decide how to turn them on.
function lightSwitch()
{
document.getElementById("switchoff").style.opacity = '0.2';
}
I am very new to JavaScript, so I'm sure the solution is simple.
source
share