How to check or uncheck checkbox input or radio button in jQuery

In this post , we will see how to check or uncheck checkbox or radio button in jQuery.
You can use prop() method to set "checked" as true or false. If you set it to true, it will be checked else it will be unchecked.
prop() function required jQuery 1.6 or more.
To check a checkbox/radio button.
$('selector').prop( "checked", true );
To uncheck a checkbox/radio button.
$('selector').prop( "checked", false);
Lets understand with the help of simple example:
<title>jQuery check/uncheck a check box example</title>
 <script src=""></script>

<h1>jQuery check / uncheck a check box example</h1>

<script type="text/javascript">

    $("#checkIt").click(function () {

 $('#checkme').prop( "checked", true );


    $("#UnCheckIt").click(function () {

 $('#checkme').prop( "checked", false );



<input id="checkme" type="checkbox" name="checkme">Check Me</input>

<input type='button' value='Check It' id='checkIt'>
<input type='button' value='UnCheck It' id='UnCheckIt'>


Live Demo: 

jQuery check/uncheck a check box example on

Written by Arpit:

If you have read the post and liked it. Please connect with me on Facebook | Twitter | Google Plus


Java tutorial for beginners Copyright © 2012