js addeventlistener mousedown code example
Example 1: add mousedown event listener javascript
object.addEventListener("mousedown", myScript);
Example 2: javascript mouse up mouse down
<p id="myP" onmousedown="mouseDown()" onmouseup="mouseUp()">
<script>
function mouseDown() {
}
function mouseUp() {
}
</script>