<div onmousedown="WhichButton(event)"><a href="http://www.example.com">Click this text with one of your mouse buttons to return a number. It should open the dialog and not navigate or download anything.</a>
</div>

<script>
function WhichButton(event) {
    alert("You pressed button: " + event.button)
    return false;
}
</script>
