Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
  <style>
    #led1{
    position: relative;
    width: 100px;
    height: 100px;  
    }
  </style>
  <script>
     
   function ledonoff(led,checkBox){
       var theDiv = document.getElementById(led),
           check = document.getElementById(checkBox);
       if (check.checked == true){
  theDiv.innerText = "ted_green";       //theDiv.style.backgroundImage="url('Image/led_green.gif')";
       } else {
        theDiv.innerText = "ted_red"; 
         //theDiv.style.backgroundImage="url('Image/led_red.gif')";
      }
    }
  </script>
</head>
<body>
  <div id="led1"></div>
<input name="" type="checkbox" id="ck1" onchange="ledonoff('led1','ck1')" value=""/>Led 1
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers