I am trying to add all values of a tablerow together. This as soon as someone enters a value into an inputfield. table:
<table>
<thead>
<tr>
<th>
Title
</th>
<th>
Input
</th>
<th>
Total
</th>
</tr>
</thead>
<tbody>
<!-- Dynamially Generated Table Columns -->
<tr>
<td>Example</td>
<td><input type="text" class="inputField" /></td>
<td>Total: x</td>
</tr>
</tbody>
</table>
The only solution I've found so far is:
$(document).on('input', '.inputField', function(){ /* Do something */});
The Problem here is, that this line reads all input fields in the document, but I only want those of one row.
Also if I'd change it to 'tbody' it would just read all fields of the tablebody.
So what I am looking for is a way to just select those inputs of one single tablerow, so I can take those values and add them together.
Thanks a lot for the help!
<input>elements within one<tr>in reality?