jquery-tutorialsmade

Check if checkbox is checked with jQuery!

If you are a programmer sure you will be often working with forms and most of the time there will be a Check Box at the bottom of the form with ‘I agree to the T&C’.  Here is the problem, after you do all the the other validations you will be stopping at the final checkbox thinking how to find out if the checkbox is checked?

There are plenty of methods you can use jQuery to test if a checkbox is checked or not!. But this one is the correct and easiest method to check.

Here it is:

Basically the above code will return true or false!.

$( ‘yourselector’ ).is( ‘:checked’ );

Easy isn’t it?, here is an example code, so you can get a clear idea from this:

I hope this would have helped you a little. Thanks for coming!

Related Posts

Leave a Reply