I want to know the number of times a word appears in my table (DataTables)
var numberOccurence = $('tr > td:nth-child(2):contains("'+ word +'")').length;
The problem is that it looks only on the visible part of the table, that is, if there are 10 pages on DataTables, it only gives me the number of occurrences on the first page
How to do it?
EDIT Here is the Html
<div class="table-row">
<div class="table-responsive">
<table id="fileTable" class="table table-striped table-bordered">
<thead>
<tr>
<th>Date</th>
<th>Localisation</th>
<th>User</th>
<th>Like</th>
</tr>
</thead>
<tbody>
<?php foreach ($orders as $order) { ?>
<tr>
<td><?= $order['date'] ?></td>
<td><?= $order['localisation'] ?></td>
<td><?= $order['user'] ?></td>
<td><?= $order['like'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>