In jQuery, you can use attr() function to check or unchecked a checkbox dynamically. For example,

A simple checkbox component.

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

1. To display whether this checkbox is checked or not (return true or false).


2. To check a checkbox.


3. To uncheck a checkbox.


jQuery check / unchecked checkbox example

<title>jQuery check / uncheck a check box example</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<h1>jQuery check / uncheck a check box example</h1>
<script type="text/javascript">
    $("#isCheck").click(function () {
    $("#checkIt").click(function () {
    $("#UnCheckIt").click(function () {
<input type="checkbox" name="checkme">Check Me</input>
<input type='button' value='Is Check' id='isCheck'>
<input type='button' value='Check It' id='checkIt'>
<input type='button' value='UnCheck It' id='UnCheckIt'>
Tags :
Founder of, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.
My website is hosted by Liquid Web, I really like their fast and helpful support, it saved me a lot of time. Furthermore, their servers are extremely reliable, fast and stable, I don't remember when was the last time we had server downtime. Btw, they're offering $100 Coupon now, if you are sourcing for great hosting provider, go grab it.

Related Posts

Popular Posts