<input type=text id=mytext>Use this code:
$(document).ready(function() { $('#mytext').change(function() { console.log('changed to ' + $(this).val()); }); });Or for a checkbox:
<input type=checkbox id=mycheck>Use this code:
$(document).ready(function() { $('#mycheck').checked(function() { const val = $(this).prop('checked'); console.log('changed to ' + val); }); });