> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/browser/event/type/mouse/.buttons.md).

# .buttons

[browser](/web/browser.md) ⟩ [event](/web/browser/event.md) ⟩ [type](/web/browser/event/type.md) ⟩ [mouse](/web/browser/event/type/mouse.md) ⟩ .buttons&#x20;

{% hint style="success" %}
a <mark style="color:yellow;">**number**</mark> representing mouse <mark style="color:yellow;">**button combinations**</mark>.

* each button is represented by a given number (see below).&#x20;
* if more than one button is pressed, the <mark style="color:yellow;">**button values are**</mark>**&#x20;**<mark style="color:orange;">**added**</mark>.
  {% endhint %}

<img src="/files/PzeBtaVO36yIafiKrtJj" alt="mouseEvent.buttons" class="gitbook-drawing">

{% tabs %}
{% tab title="💈範例" %}

* [drag the bar](/web/browser/event/type/mouse/move/drag-the-bar.md) - listen to "[**mousemove**](/web/browser/event/type/mouse/move.md)" on bar.mousedown.
  {% endtab %}

{% tab title="👥 相關" %}

* compare with [.button](/web/browser/event/type/mouse/.button.md) (number associated with each button)
  {% endtab %}

{% tab title="📘 手冊" %}

* [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event) ⟩ [UIEvent](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) ⟩ [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) ⟩
  * [.buttons](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons) - which buttons are pressed.
  * [.button](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button) - compare with .buttons. (#todo)
    {% endtab %}
    {% endtabs %}
