I have a table with too many rows like this:

HTML Code:
<td><?php echo $productName; ?></td>
<td><input type="text" name="UnitPrice[]" value="<?php echo $productPrice;>" readonly="true"></td>
<td><input type="text" name="Quantity[]" value="0" onChange="doCalculation();"></td>
<td><input type="text" name="Price[]" value="0" readonly="true"></td>
<p> Total Price : <input type="text" name="TotalPrice" value="0" readonly="true"></p>
User can fill Quantity column.

I want to calculate "Total Price" and "Item Price (unitPrice x Price)" in the doCalculation() function when user change "Quantity" columnn of table.

How can I do this ?