title: How to check the input checkbox field with a value on page load using jquery
body: <pre><code>&lt;script&gt;
      $(document).ready(function(){
          $( window ).load(function() {
              $( "#check" ).val('hurray_checked');
          });
      });
  &lt;/script&gt;       
  
  
  &lt;input id="check" type="checkbox" name="should_be_checked_when_pageloads" value="" /&gt;
  </code></pre>
  
  <p>So what all i want is when the page loads, the below field should become</p>
  
  <pre><code>&lt;input id="check" type="checkbox" name="should_be_checked_when_pageloads" value="hurray_checked" /&gt;
  </code></pre>
  
  <p>But my above code is not working, can anyone please let me know how to check a field with a value when page loads ?</p>