1

I have created a dynamic table using JS. Each cell of table contains input fields. I am performing arithmetic operations on input fields. The code is working fine for first input field. But whenever i try to access 2 and further input fields it still gives me result of first input. But it is only giving me result of first input field.

// var lastRow = $(this).closest("tr");
if ($(this).find('input').length) {
 
  if (equation[j] == $(tr).find('td:eq(0)').find('input[type="text"]').val()); {
   


    p2 = equation[j];
    var1[1] = $(tr).find('td:eq(1)').find('input[type="number"]').val();
    var2[1] = $(tr).find('td:eq(2)').find('input[type="text"]').val();
    

Any idea on how to access second and further fields.?

0 Answers0