jquery checkbox set checked
snippet in javascript

jquery set checkbox checked

user2520

//jQuery 1.6+ use
$('.checkbox').prop('checked', true);
//jQuery 1.5.x and below use
$('.checkbox').attr('checked', true);

jquery set checkbox

user375

//jQuery 1.6+ use:
$('.checkboxClass').prop('checked', true);
//jQuery 1.5.x and below use:
$('.checkboxClass').attr('checked', true);

jquery checkbox set checked

user7617

//For jQuery 1.6 and above
$('#myCheckBoxID').prop('checked', true);
//For jQuery Before 1.6
$('#myCheckBoxID').attr('checked','checked');

how to set checkbox checked

user8553


    <form 
    action="/action_page.php">

   <input type="checkbox" name="vehicle1" value="Bike">
  <label 
    for="vehicle1"> I have a bike</label><br>
  <input type="checkbox" 
    name="vehicle2" value="Car">
  <label for="vehicle2"> I have a 
    car</label><br>
  <input type="checkbox" name="vehicle3" 
    value="Boat" checked>
  <label for="vehicle3"> I have a 
    boat</label><br><br>
  <input type="submit" value="Submit">

    </form>



#If if helps you give it Thumbs up