I have code like this.
<input type="text" name="1" class = "inp<?=$p?> ">
<input type="text" name="2" class = "inp<?=$p?> ">
<input type="text" name="3" class = "inp<?=$p?> ">
<input type="text" name="4" class = "sum<?=$p?> ">
Here the jquery code
$('.inp0').keyup(function(){
var sum = 0;
var ave = 0;
$('.inp0').each(function(){
sum += +$(this).val();
});
ave = sum/3;
$('.sum0').val(ave.toFixed(2));
});
and it work properly but just for 1 row of input form.
if i do loop to my jquery code like
for(x=0;x<5;x++)
{*jquery code here*}
and change jquery selector to $('.inp'+x), only 5th row that can work but not for row 1 to 4.
can someone help me ? thanks before