title: javascript check a box with value
body: <p>I am trying to check boxes in JS. I wan't to only check when the value is equal to 0, if not don't check it. my code :</p>
  
  <pre><code>document.onreadystatechange = function check(e)
  {
      if (document.readyState === 'complete')
      {           
          var inputElements = document.getElementsByTagName("input");
          for(var i=0; i &lt; inputElements.length; ++i)
          {               
              if(document.getElementsByTagName("input")[i].value == "1")
              {
                document.getElementById("date").checked = false;
              }        
          }
      }
  }
  </code></pre>
  
  <p>But it doesn't work. Can you help me?</p>
  
  <p>thanks</p>