mouse pressed event javascript code example
Example 1: javascript mouse up mouse down
<p id="myP" onmousedown="mouseDown()" onmouseup="mouseUp()">
<script>
function mouseDown() {
}
function mouseUp() {
}
</script>
Example 2: javascript mouse events
element.addEventListener("mousemove", function(event) {
console.log(event);
}); //Calls function every time the mouse moves over 'element'