In the table row I have click event like onclick="trDetailsModal(this, 'id')"
and I am showing details in the modal. So inside the tr I have also two buttons under actions td, those buttons are also having onclick event like onclick="deleteRecord('id')"
;
I am able to see details in a modal by clicking on tr.
Now the problem is when I click one of the buttons the tr onclick
also getting triggered and showing details also in model.
So how to stop tr onclick
while clicking one of those buttons.
Code:
$content .= '<tr class="trClass" onclick="trDetail(this, '.$val->id.');">';
$content .= '<td>some value</td>';
$content .= '<td><button onclick="deleteRecord('.$val->id.')"></td>';
$content .= '</tr>';
function deleteRecord(id){
$(".trClass").off("click");
$("#myModal").hide();
}