files/en-us/web/api/element/mousedown_event/index.md
{{APIRef("UI Events")}}
The mousedown event is fired at an {{domxref("Element")}} when a pointing device button is pressed while the pointer is inside the element.
This differs from the {{domxref("Element/click_event", "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 {{domxref("Element/pointerdown_event", "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 {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.
addEventListener("mousedown", (event) => { })
onmousedown = (event) => { }
A {{domxref("MouseEvent")}}. Inherits from {{domxref("UIEvent")}} and {{domxref("Event")}}.
{{InheritanceDiagram("MouseEvent")}}
This interface also inherits properties of its parents, {{domxref("UIEvent")}} and {{domxref("Event")}}.
true if the <kbd>alt</kbd> key was down when the mouse event was fired.true if the <kbd>control</kbd> key was down when the mouse event was fired.true if the <kbd>meta</kbd> key was down when the mouse event was fired.true if the <kbd>shift</kbd> key was down when the mouse event was fired.MOZ_SOURCE_* constants).
This lets you, for example, determine whether a mouse event was generated by an actual mouse or by a touch event (which might affect the degree of accuracy with which you interpret the coordinates associated with the event).See mousemove event for example code.
{{Specifications}}
{{Compat}}