when html checkbox is checked, element "checked" will be added to it, and when its unchecked this element will be removed. so to know whether its cheked or not we need to know whether it has the element checked or no.
and to find this out:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script>
$(function()
alert($("#test").attr("checked"));
});
</script>
<input type="checkbox" id="test" />
this code will either show us true or false, we can use if statement like that:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script>
(function() {
if($("#test").attr("checked")) {
alert("its checked");
} else {
alert("its not checked");
}
});
</script>
<input type="checkbox" id="test" />if you have any question, comment.





