My html is
<tr>
<td>
<a id="@td.Id" href="javascript:void(0);" class="details">
<i class="fal fa-search-plus"></i>
</a>
</td>
</tr>
How can i toggle the class from fa-search-plus
to fa-search-minus
and vice versa
by using the .details
click event?
$('#myTable tbody').on('click', '.details', function (e) {
e.preventDefault();
var table = $('#myTable').DataTable();
var tr = $(this).closest('tr');
var row = table.row(tr);
});
As you may notice, i wish to apply the toggle class on the selected child node and not in the selected one.