Question: I used to use the following to know if a clicked item was a checkbox:

```
if ($(e.target).className === 'checkbox') {}

```

After upgrading to the latest version of jQuery this now returns undefined for Chrome, Safari and Firefox.

What is the best way to determine if a click happened on a checkbox?

Thanks

Answer: 
Try using `.is` function and `:checkbox` selector

```
if ($(e.target).is(':checkbox')) {
   //it is a checkbox
}

```

**DEMO:** <http://jsfiddle.net/a5SbG/1/>

or You can try

```
if (e.target.type == 'checkbox') { 
  //It is a checkbox
}

```

**DEMO:** <http://jsfiddle.net/a5SbG/>
```
       $(document).ready(function () {
       $("input:checkbox").click(function () {
           if ($(this).is(":checked")) {
               //Do Stuff if Checked
           } 
       });
   }); 

```