When certain events occur on a form, I need to perform some actions:
1) Modify the value of an input text box using the keyboard or mouse (pasting) 2) Check/uncheck a checkbox 3) Change the selected option in a select dropdown
Currently, I am handling these events individually like this:
$(':text').on('input', function() {
//Code
}
$(':checkbox').on('change', function() {
//Code
}
$('select').on('change', function() {
//Code
}
However, I would like to consolidate all these event handlers into a single function like this:
$(':text, :checkbox, select').on('???', function() {
//Code
}
I would appreciate any help with this. Thank you.
Best regards