title: Grey out a div using a checkbx
body: <p>I need to grey out / disable a div when a checkbox is selected. </p>
  
  <p>Anyone can help me with an example on JSfiddle maybe? </p>
  
  <p>This is my code: <a href="http://jsfiddle.net/albertoc/vFrAB/5/" rel="nofollow">http://jsfiddle.net/albertoc/vFrAB/5/</a></p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div id="wrap" style="width:500px"&gt;
      &lt;div id="content"&gt;
          &lt;p&gt;This box will be disabled! &lt;a href="#"&gt;Link&lt;/a&gt;
          &lt;/p&gt;
      &lt;/div&gt;
      &lt;div id="darkLayer" class="darkClass" style="display:none"&gt;&lt;/div&gt;
      &lt;div id="checkbox"&gt;
          &lt;form&gt;
              &lt;input type="checkbox" id="myCheckBox" /&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>CSS:</strong></p>
  
  <pre><code>.darkClass
  {
      background-color: white;
      filter:alpha(opacity=50); /* IE */
      opacity: 0.5; /* Safari, Opera */
      -moz-opacity:0.50; /* FireFox */
      z-index: 20;
      height: 100%;
      width: 100%;
      background-repeat:no-repeat;
      background-position:center;
      position:absolute;
      top: 0px;
      left: 0px;
  }
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>function dimOff()
  {
      document.getElementById("darkLayer").style.display = "none";
  }
  function dimOn()
  {
      document.getElementById("darkLayer").style.display = "";
  }
  </code></pre>