Disable right click USING JQUERY
<table id="tableID" border=1>
<tr>
<td class="disableRightClick">right click disable</td>
<td>right click</td>
</tr>
<tr>
<td >right click</td>
<td class="disableRightClick"> no right click</td>
</tr>
</table>
JS FILE
//to disable right click in entire document
//uncomment this to check the rightclick diabled for entire document
/*
$(document).on("contextmenu",function(e){
alert('right click disabled');
return false;
});
*/
//to diable right click in certain element
$('.disableRightClick').on("contextmenu",function(e){
return false;
});
<tr>
<td class="disableRightClick">right click disable</td>
<td>right click</td>
</tr>
<tr>
<td >right click</td>
<td class="disableRightClick"> no right click</td>
</tr>
</table>
JS FILE
//to disable right click in entire document
//uncomment this to check the rightclick diabled for entire document
/*
$(document).on("contextmenu",function(e){
alert('right click disabled');
return false;
});
*/
//to diable right click in certain element
$('.disableRightClick').on("contextmenu",function(e){
return false;
});
Comments
Post a Comment