1//jQuery 1.6+ use
2$('.checkbox').prop('checked', true); //false for uncheck
3//jQuery 1.5.x and below use
4$('.checkbox').attr('checked', true); //false for uncheck
1$('#myCheckbox').prop('checked', true); // Checks it
2$('#myCheckbox').prop('checked', false); // Unchecks it
1if ($("#check_box_id").is(':checked')) {
2 alert("checked");
3}else{
4 alert("unchecked");
5}
1$("input:radio[name='NAME']:radio[value='VALUE']").attr("checked",true);
2$("input:radio[name='NAME']").removeAttr("checked");
3
1$('#submit').click(function(){
2 var redval = $('.red').val();
3 var grenval = $('.green').val();
4 $('.showCheckedValue').text(redval+'&'+grenval );
5 });