<div class="form-group">
<label class="w-20" id="loan_no_label"><?= "<font class='red'> * </font>" . __('loan-number') ?></label>
<input class="w-65 form-control" id="loan_no" required type="text" name="loan_no" />
</div>
$('#is_all_loan').on('click', function() {
var checked = $(this);
if (checked.is(':checked')) {
$('#loan_no_label').html('<?= __('loan-number'); ?>');
$('#loan_no').attr('required', false);
} else {
$('#loan_no_label').html("<font class='red'> * </font>貸款編號");
$('#loan_no').attr('required', true);
}
});
// 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.' );
});
$(document).on('change', 'input', function() {
// Does some stuff and logs the event to the console
});
$("#input").change(function(){
alert("The text has been changed.");
});
// On element change.
$('mydiv').bind('DOMSubtreeModified', function () {
console.log('changed');
});