Click on row except one specific td by jquery
<script type="text/javascript">
$(document).ready(function(){
$("#example").DataTable();
$("#example tbody").on("click","tr",function(e){
alert("clicked on tr");
var cell=$(e.target).closest('td');
if(cell.index()==5 ){
alert("Dont Run");
}
else{alert("Run");
}
});
});
\*\\\\\\\\\\\\\\\\\\\\\\\\\\Or you may use following also\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*\
$(document).ready(function(){
$("#example").DataTable();
$("#example tbody").on("click","tr",function(e){
alert("clicked on tr");
var cell=$(e.target).closest('td');
if(cell.index()!= 5 ){
alert("Dont Run");
}
});
});
Comments
Post a Comment