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
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
});