Ich habe versucht, die td-Werte Zeile für Zeile, wenn das Kontrollkästchen aktiviert ist. Unten ist mein HTML-Tabellenformat.Wie bekomme ich td-Werte Zeile für Zeile, wenn das Kontrollkästchen aktiviert ist
<table class="example">
<tr role="row" class="odd ">
<td class=""><input type="checkbox" value="12"></td>
<td class="sorting_1">Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>$162,700</td>
</tr>
<tr role="row" class="even">
<td class=""><input type="checkbox" value="12"></td>
<td class="sorting_1">Airi Satou1</td>
<td>Accountan1t</td>
<td>Tokyo1</td>
<td>331</td>
<td>$162,7001</td>
</tr>
</table>
<input type="submit" class="tble_submit">
Basierend auf der Auswahl der Checkboxen brauche ich die td-Werte. Wenn ich beides überprüfe, dann brauche ich beide tr td. Ich habe versucht mit unten jquery Code, der immer die ersten tr td Werte zurückgibt, auch wenn ich beide Checkboxen überprüfte.
$(".tble_submit").click(function(){
$('.example tr input[type="checkbox"]:checked').each(function(){
var chk_len = $('.example input[type="checkbox"]:checked').length;
for(i=0;i<=chk_len;i++){
if ($('.example tr:eq('+i+') td input[type="checkbox"]:checked')){
var $row = $(this).parents('tr');
var table_len = $('.example tr:eq('+i+') td').length;
var ab = $('.example tr td:eq('+i+') input').val();
alert(ab)
for(i=1;i<table_len;i++){
var abc = $('.example tr td:eq('+i+')').html();
alert(abc)
}
}
}
});
});
Bitte helfen Sie mir dabei. Danke im Voraus.
das funktioniert viel einfacher sein. . Danke vielmals – saminathan