title: Disabling a checkbox in html
body: <p>I am trying to disable a check box which is in table data</p>
  
  <pre><code>&lt;table style="width:100%"&gt;
    &lt;tr&gt;
      &lt;th&gt;Date&lt;/th&gt;       
      &lt;th id="spanDate"&gt;&lt;/th&gt;
      &lt;th id="spanDate1"&gt;&lt;/th&gt;        
      &lt;th id="spanDate2"&gt;&lt;/th&gt;
    &lt;/tr&gt;
  
    &lt;tr&gt;
      &lt;td&gt;00:00-03:00&lt;/td&gt;
      &lt;td&gt;
          &lt;input type="checkbox" id="c" name="time" value="00:00-03:00"&gt;
          &lt;button onclick="fun()"&gt;&lt;-&gt;&lt;/button&gt;
          &lt;script&gt;
              function fun()
              {
                   document.getElementById("c").disabled=true;
              }
          &lt;/script&gt;
     &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p></p>
  
  <p>but when I click the button the page refreshes but the check box is still enabled.</p>