The oninput
event is only triggered when the text of an input changes, so it won't be fired for checkboxes. Try binding to the change
event for checkboxes and the input
event on textareas:
$("textarea").on("input", yourFunction);
$("input:checkbox").on("change", yourFunction);
function yourFunction() {
alert("CHANGED");
}
jsFiddle which demonstrates the above.
Note: The difference in this answer is the alert
is triggered immediately in the textarea
, not only on blur of the element.
Additional Note: The oninput
event isn't supported in < IE9