JSFiddle - React, Tailwind, and code Playground
HTML
<button id="search-query-send">send</button>
<table cellpadding="0" cellspacing="0" border="1" width="100%" class="bookings-aligntop container-table">
<tbody>
<tr><th colspan="2"><h2><i class="fa fa-map-marker"></i>Locations</h2></th></tr>
<td style="width:48%;float:left;" id="<?php echo $i; ?>">
<div class="apartment-entry-container">
<table cellpadding="0" cellspacing="0" border="1" width="100%" class="bookings-aligntop container-table apartment-entry">
<tbody>
<tr>
<td width="66%">
<p class="selectthis"><input type="checkbox" name="selectthis" id="selectthis">Select this appartment</p>
</td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" border="1" width="100%" class="bookings-aligntop container-table apartment-entry">
<tbody>
<tr>
<td width="66%">
<p class="selectthis"><input type="checkbox" name="selectthis" id="selectthis">Select this appartment</p>
</td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" border="1" width="100%" class="bookings-aligntop container-table apartment-entry">
<tbody>
<tr>
<td width="66%">
...
JavaScript
jQuery('#search-query-send').click(function() {
jQuery('.selectthis input:checked').each(function() {
var content = jQuery(this).parents('table').html();
console.log(content);
});
});