I'm a beginner on this so please be patient with me. I have look up this problem and did not found a solution. I have the following code:
on the head
<script>
function ledonoff(led)
{
if (document.getElementById('ck1').checked == true){
document.getElementById('led1').style.backgroundImage="url('Image/led_green.gif')";}
else {
document.getElementById('led1').style.backgroundImage="url('Image/led_red.gif');}
}
</script>
on the body
<div id="led1"></div>
<input name="" type="checkbox" id="ck1" onchange="ledonoff('led1')" value=""/>
I will like to have the function ledonoff take 2 parameters to be used in function : div id to be changed and checkbox that is to be verified on the if of the function. Can anyone help me with this. Thank you
</script>at the beginning? That's probably the source of the problem.