title: check / uncheck checkbox using jquery?
body: <p>I have some input text fields in my page and am displaying their values using JavaScript.</p>
  
  <p>I am using <code>.set("value","")</code> function to edit the value, add an extra checkbox field, and to pass a value.</p>
  
  <p>Here I want to check that if <code>value == 1</code>, then this checkbox should be checked. Otherwise, it should remain unchecked. </p>
  
  <p>I did this by using two divs, but I am not feeling comfortable with that, is there any other solution?</p>
  
  <pre><code>if(value == 1) {
      $('#uncheck').hide();
      $('#check').show();
  } else{
      $('#uncheck').show();
      $('#check').hide();
  }
  </code></pre>