<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
$(function(){
$(document).on("mousedown", "a.external", function(e) {
console.log(e.which);
if( e.which <= 2 ) {
e.preventDefault();
console.log ("Button clicked: " + e.which);
}else{
console.log ("Button clicked else: " + e.which);
}
});
});
</script>
</head>
<body>
<a class="external">Test</a>
</body>
</html>