[jquery] jQuery checkbox onChange

I have a checkbox with an id of activelist

I tried the following but did not seem to work (I have below in) :

_x000D_
_x000D_
$(document).ready(function () {_x000D_
  $('#activelist :checkbox').change(function () {_x000D_
    alert('changed');_x000D_
  });_x000D_
});
_x000D_
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>_x000D_
<input type="checkbox" id='inactivelist' value="inactivelist" />
_x000D_
_x000D_
_x000D_

This question is related to jquery

The answer is


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

There is a typo error :

$('#activelist :checkbox')...

Should be :

$('#inactivelist:checkbox')...