document on change code example

Example 1: jQuery checkbox changed event

//jQuery listen for checkbox change
$("#myCheckBoxID").change(function() {
    if(this.checked) {
        //I am checked
    }else{
        //I'm not checked
    }
});

Example 2: jquery on change

$(document).on('change', 'input', function() {
  // Does some stuff and logs the event to the console
});

Example 3: document.on chenage jquer

$(document).on('change', 'input', function() {
  // Does some stuff and logs the event to the console
});

Example 4: jquery detect textarea change

$('#myTextAreaID').on('input propertychange paste', function() {
    //my Textarea content has changed
});

Tags:

Html Example