Alex Rivera | Logout

How to listen to when a checkbox is checked in Jquery

Asked 2011-07-29T20:39:25.403
85

I need to know when any checkbox on the page is checked:

e.g.

<input type="checkbox">

I tried this in Jquery

$('input type=["checkbox"]').change(function(){
alert('changed');
});

But it didn't work, any ideas?

Edit
Report

1 Answer

0
$("input[type='checkbox']").click(function(){
    alert("checked"); 
});

Just a normal .click will do.

answered 2011-07-29T20:41:26.293

Your Answer