The mousedown event is fired at an Element when a pointing device button is pressed while the pointer is inside the element.
This differs from the click event in that click is fired after a full click action occurs; that is, the mouse button is pressed and released while the pointer remains inside the same element. mousedown is fired the moment the button is initially pressed.
This behavior is different from pointerdown events. When using a physical mouse, mousedown events fire whenever any button on a mouse is pressed down. pointerdown events fire only upon the first button press; subsequent button presses don't fire pointerdown events.
Use the event name in methods like addEventListener(), or set an event handler property.
addEventListener("mousedown", (event) => { })
onmousedown = (event) => { }A MouseEvent. Inherits from UIEvent and Event.
See mousemove event for example code.