I have an html table which when clicked in a row gets me a value that I want to recover, How can I concatenate values in an input every time I get a value?
$("table tbody tr").click(function() {
var total = $(this).find("td:last-child").text();
alert(total);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<thead>
<tr>
<th>header 1</th>
<th>header 2</th>
<th>header 3</th>
<th>total</th>
</tr>
</thead>
<tbody>
<tr>
<td>celda 1</td>
<td>celda 2</td>
<td>celda 3</td>
<td>3.000</td>
</tr>
<tr>
<td>celda 1</td>
<td>celda 2</td>
<td>celda 3</td>
<td>2.000</td>
</tr>
</tbody>
</table>