I have two input fields with label empID and Name with calsses empID and Name, also has a table with class tbl1 that has 3 columns tblempID, tblName and tblTxt with calsses tblempID, tblName, tblTxt. How to set empID field value to be the same tblmpID value when any tblTxt cell value changed in each row in table.
T tried the following:
$(document).ready(function(){ tblTxtchange(); $('.tbl1').on('change', tblTextchange); function tblTxtchange() { $('.tbl1 tbody tr').each(function () { $(this).find('.tblTxt').each(function () { $('.tblTxt').change(function(){ $('.empID').val($('.tblText') .closest('tr').find($('.tblEmpID').val())); }); }); }); } });