How to find checkbox checked using jquery?

In Jquery is a very easy solution to check checkbox selected or not. For that, you have to first know the which HTML attributes we can use to check the checkbox selection.  We are done with following two methods.

Method 1
if($('#checkbox1').is(':checked')){
  //Your Code
}else{
  //Your Code
}

Method 2
if($('#checkbox2').attr('checked')){
    //Your Code
}else{
  //your code
}



 We just started this developer diary for a beginner programmer. If anyone to be a part of this please feel free share with us your problem with solutions. So we can share with more needed coder.

Most Popular

Random post generate in wordpress

Reset the auto increment value for a MySQL table