I do not understand how to get change event to call a function.
$(function () {
function foo() {
alert("ok");
}
//works
$('#myElement').change(function() {
alert("ok");
});
//does not work
$('#myElement').change(foo);
//does not work
$('#myElement').change(foo());
}
All of the following examples should work, if not then you are doing something wrong.