Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
  <style>
    .vib1 {
      background: yellow;
    }
    .vib2 {
      background: blue;
    }
    div {
      width: 100px;
      height: 100px;
      border: 2px solid red;
    }
  </style>
</head>
<body>
  <input type="checkbox" id="snyatlen1" />
  <div class="vib1" id="men1"></div>
  <script>
    var che = document.getElementById("snyatlen1");
    var che2 = document.getElementById("men1");
    che.onchange = function() {
      che2.className = this.checked ? "vib2" : "vib1";
    };
   </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers