Hello
I'd like a help regarding clicking a table.
When I clicked on the line the data would come from this row except when clicked on a specific column (column 3 for example), because I want to do another action in the column in question.
Bringing the table data I already have, just missing the column I'd like to save.
Thank you ...
$("tr").on('click',function() {
var tableData = $(this).children("td").map(function(){
return $(this).text();
}).get();
var codigo = $.trim(tableData[0]) ;
alert('Codigo: '+codigo);
})
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.2.1.js"></script><tableclass="table table-responsive table-hover">
<thead>
<th>ID</th>
<th>Nome</th>
<th>Status</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Carlos</td>
<td>Ativo</td>
</tr>
<tr>
<td>2</td>
<td>Charles</td>
<td>Inativo</td>
</tr>
<tr>
<td>3</td>
<td>Ozeias</td>
<td>Ativo</td>
</tr>
</tbody>
</table>