Jquery cannot get value from each function

后端 未结 1 1838
余生分开走
余生分开走 2021-01-27 23:54

I am using tables with input fields in them. I am trying to get the value from set of input fields with same class and compare to each of its adjacent input with diffrent class

相关标签:
1条回答
  • 2021-01-28 00:10

    You're using the incorrect variable. Use price instead of pr

    $('.subtotal').each(function(){
            var price = $(this).parent().parent().find('td input.price');
            console.log(price.val()); //This should be price not pr
     });
    
    0 讨论(0)
提交回复
热议问题