Try capturing the contextmenu
event and calling preventDefault()
in that handler:
$('#mydiv').mousedown(function (event) {
if ((event.which == 3) && (event.target.nodeName == 'SPAN')) {
$("#outpdiv").append($(event.target).text().concat(" , "));
}
});
$(document).on('contextmenu', function(e) {
e.preventDefault();
});
In response to your comment. If you only want to disable the context menu when you click that particular div, you can bind the handler to it. Switching between jQuery and native event handlers is messy, IMO:
$('#mydiv').on('contextmenu', function(e) {
e.preventDefault();
});