I wants to get all the row's records, even it has 2 or 3 columns.
I want to get all the values from tbody
.
I tried this code. But it doesn't work
Here is code
$("#btnSearch").click(function() {
$("table > tbody > tr").each(function() {
alert($("#FieldNameID").text() + " " + $("#OperatorID").text());
});
return false;
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button id="btnSearch">Search</button>
<table class="table table-hover " id="queryTable">
<thead>
<tr>
<th>Field Name</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td class="FieldNameID">tq.StoreID</td>
<td class="OperatorID"> IN('1001')</td>
</tr>
<tr>
<td class="FieldNameID">AND item.SubDescription1</td>
<td class="OperatorID"> IN('215')</td>
</tr>
<tr>
<td class="FieldNameID">AND dept.Name</td>
<td class="OperatorID"> IN('Rent Department')</td>
</tr>
<tr>
<td class="FieldNameID">AND sup.SupplierName</td>
<td class="OperatorID"> IN('MOHAMMED ABDUL RAHMANمحمد عبد')</td>
</tr>
<tr>
<td class="FieldNameID">AND sup.SupplierName</td>
<td class="OperatorID"> IN('MACRONA FACTORYمحمد يسلم ناصر')</td>
</tr>
</tbody>
</table>