Consider the following demo code:
<p id="demo" style="border: 1px solid black;width:300px;height:300px"></p>
<script>
document.getElementById("demo").onmousedown = function(e){ alert('mousedown'); }
document.getElementById("demo").onmouseup = function(e){ alert('mouseup'); }
document.getElementById("demo").onclick = function(e){ alert('click'); }
</script>
Can someone please explain to me why neither the mouseup nor click events get fired?