javascript event detect mouse down code example
Example 1: javascript mouse up mouse down
<p id="myP" onmousedown="mouseDown()" onmouseup="mouseUp()">
<script>
function mouseDown() {
}
function mouseUp() {
}
</script>
Example 2: js detect mouse support
if (matchMedia('(pointer:fine)').matches) {
// Device has a mouse
}