tags:

views:

107

answers:

1

is there a simple way to find out if a checkbox is checked in jquery.

something like .checked or ischecked

+4  A: 
el.is(':checked')

That's the jQuery way. At its core, though, it's just a bit more parsing to get down to el[0].checked, using the raw DOM property, so take whichever you prefer. The DOM method is probably better for actually testing an element, whereas :checked is better for selecting it in the first place.

Matchu
Excellent. That works! you are great
Vivek Chandraprakash
@Vivek Chandrapravash - glad to help :) Be sure to click on the check mark next to an answer once you're allowed, to help boost that 44% accept rate ;)
Matchu
`el[0].checked`, no reason to not use the DOM property when in an `if` statement, it's much faster :)
Nick Craver
@Nick Craver - edited in :)
Matchu
@Matchu i tried to tick the tick asa i saw ur reply. but it didn't allow.. now i ticked...thanku
Vivek Chandraprakash