I have the following problem: There is a table with several rows and columns, I wish that with the mouse I click on a row and I separated three values of the six columns that I have. But, the values obtained should be ONLY OF THAT ROW.
Annex the code that I have:
$(document).ready(function() {
$("#dataGrid tr").on('click', function() {
var toma1 = "", toma2 = "", toma3 = "";
$("#dataGrid").find("tr").each(function() {
toma1 += $(this).find('td:eq(1)').html();
toma2 += $(this).find('td:eq(3)').html();
toma3 += $(this).find('td:eq(5)').html();
});
$("#respuesta").text(toma1 + toma2 + toma3);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table id="dataGrid">
<tr>
<td>1111111</td>
<td>222222</td>
<td>3333333</td>
<td>4444444</td>
<td>55555555</td>
<td>66666</td>
</tr>
</table>
<label id="respuesta"><label>