<p id="myP" onmousedown="mouseDown()" onmouseup="mouseUp()"> <script> function mouseDown() { } function mouseUp() { } </script>