jQuery – Check if a Checkbox is CHECKED

So many “check” in this post title. haha~

You can get the checkbox state by the the following jQuery.

// true if checked


Try the following HTML.

    <title>jQuery - Check if Checkbox is CHECKED</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
        $('#checkbox-id').click(function() {
          // For older version of jQuery 
    <input id="checkbox-id" type="checkbox" />


Done =)

Reference: jQuery: 判斷 checkbox 是否被選取


2 thoughts on “jQuery – Check if a Checkbox is CHECKED”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.