Let's say we have a table like this:
<table>
<thead>
<tr>
<th class="active">
<input type="checkbox" class="select-all checkbox" name="select-all" />
</th>
<th>A</th>
<th>B</th>
</tr>
</thead>
<tbody>
{% for gene_variant in gene_variant_results %}
<tr>
<td class="active">
<input id="selectedGene" type="checkbox" class="select-item checkbox" name="select-item"/>
</td>
<td>{{ gene_variant.67 }}</td>
<td> {{ gene_variant.72 }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<button id="select-all" class="btn btn-primary">Select all</button>
<button type="submit" id="show-selected" class="btn btn-primary">Show selected</button>
And let's say that gene_variant_results has for example, 4 results. Each result corresponds to a row (each row has about 100 columns, in this example I only put 11 for illustrative purposes):
(1290, 'chr10', '73498294', '73498294', 'C', 'G', 'exonic', 'CDH23', 'DM', 'CM127233', 'DFNB12)
(1291, 'chr11', '73498295', '73498295', 'D', 'H', 'exonic', 'CDH24', 'DM', 'CM127234', 'DFNB13)
(1292, 'chr12', '73498296', '73498296', 'E', 'I', 'exonic', 'CDH25', 'DM', 'CM127235', 'DFNB14)
(1293, 'chr13', '73498297', '73498297', 'F', 'J', 'exonic', 'CDH26', 'DM', 'CM127236', 'DFNB15)
For example, if I click on the first two checkboxes and then click on the #show-selected button, I would like to store in a JavaScript variable the values of those selected rows. (The full gene_variant content, not just the selected <td> values)
Some illustrative semi pseudo-code of what I want:
$( "#show-selected" ).click(function() {
var selected_checkboxes = //get the full content of each selected row and store it in an array of strings or any other data structure
});