I would like to get the value of a column from the table, but in a way that I could reuse the function to get values from other tables.
I tried the following, but it does not show me anything on the console.
NOTE: The value for the line only.
HTML
<table class="table">
<thead></thead>
<tbody class="table-hover">
<tr>
<td id="id">2</td><td>Cliente N - 1</td>
<td>teste</td>
<td>2017-02-14 22:00:52</td>
<td class="txt-center pointer"><span class="glyphicon glyphicon-ok txt-error pointer" onclick="updateStatus()"></span></td>
</tr>
<tr>
<td id="id">3</td>
<td>Cliente N - 2</td>
<td>teste</td>
<td>2017-02-14 22:00:52</td>
<td class="txt-center pointer"><span class="glyphicon glyphicon-ok txt-error pointer" onclick="updateStatus()"></span></td>
</tr>
</tbody>
<tfoot></tfoot>
jQuery
function updateStatus(param){ //param seria o numero da coluna
var teste = $('table > tbody').closest('tr').find('td').eq(param).text();
console.log(teste);
}
then through the param I would indicate the column to get the value ...