xxxxxxxxxx
// modify #inputId selector as per your code
$( "#inputId" ).change(function() {
alert( "Handler for .change() called." );
});
//OR
$("#InputId").on('change', function(){
alert( 'Handler for "change" called.' );
});
// OR
$("body").on('change', '#InputId', function(){
alert( 'Handler for "change" called.' );
});
xxxxxxxxxx
$("#someDiv").bind("DOMSubtreeModified", function() {
alert("tree changed");
});
xxxxxxxxxx
// Wait until the DOM is fully loaded
$(document).ready(function() {
// Bind a change event listener to the select element
$(document).on('change', 'select', function() {
// Handle the change event here
var selectedValue = $(this).val();
console.log('Selected value:', selectedValue);
});
});
xxxxxxxxxx
$(document).on('change', 'input', function() {
// Does some stuff and logs the event to the console
});
xxxxxxxxxx
$("input").change(function(){
alert("The text has been changed.");
});
$(document).on('change', 'input', function() {
// Does some stuff and logs the event to the console
});
xxxxxxxxxx
// On element change.
$('mydiv').bind('DOMSubtreeModified', function () {
console.log('changed');
});