mardi 17 février 2015

how to extract columns from table in jquery

My table Structure is


PlayerName| PlayerNationality| PlayerPrice| Checkbox


I am copying the row of the table on check box checked, using this code



$('#one tbody tr td input.checkbox:not(:checked)').on('change',function(e){
var row=$(this).closest('tr').html();
$('#two tbody').append('<tr>'+row+'<tr>');
});


This code is working fine but I want some clarity:




  1. When I am checking the checkbox the whole row gets copied like checkboxes also gets copied what should I do for not copying that checkbox?




  2. I want to extract the second table's value, so that I can use them how to do that?




  3. Checkboxes are having some values how to get selected checkboxes values too.




Like in my second table there will be the same fields, so I should get the player-name of first row or second row and so on for other row as well as other columns.





Aucun commentaire:

Enregistrer un commentaire