You did not indicate where it #abc123is in your code. Also, are there tags <td>for identification? The following may work.
$("#abc123 input:checkbox").each(function(i) {
id = $(this).closest('td').next('td').text();
$(this).attr('id', id);
});
I'm not sure how deep yours <div id="abc123">is in <td>, so I used the closest () method to access the cell wrapper. If it is only 1 depth, i.e. No <div>, as it appears in your code, then you can just use parent (). Good luck.
source
share