Sự kiện onmouseup
Ví dụ
Gọi một hàm khi thả nút chuột qua một đoạn văn:
<p onmouseup="mouseUp()">Click the text!</p>
Hãy tự mình thử »Thêm ví dụ dưới đây.
Sự miêu tả
Sự kiện onmouseup
xảy ra khi thả nút chuột trên một phần tử .
Thứ tự sự kiện của chuột trái và chuột giữa:
- onmousedown
- onmouseup
- trong một cái nhấp chuột
Thứ tự sự kiện của nút chuột phải:
- onmousedown
- onmouseup
- oncontextmenu
Sự kiện chuột
Event | Occurs When |
---|---|
onclick | The user clicks on an element |
oncontextmenu | The user right-clicks on an element |
ondblclick | The user double-clicks on an element |
onmousedown | A mouse button is pressed over an element |
onmouseenter | The pointer is moved onto an element |
onmouseleave | The pointer is moved out of an element |
onmousemove | The pointer is moving over an element |
onmouseout | The mouse pointer moves out of an element |
onmouseover | The mouse pointer is moved over an element |
onmouseup | The mouse button is released over an element |
Xem thêm:
Hướng dẫn:
Cú pháp
Trong JavaScript, sử dụng phương thức addEventListener():
object .addEventListener("mouseup", myScript );
Hãy tự mình thử »Chi tiết kỹ thuật
Bong bóng: | Đúng |
---|---|
Có thể hủy: | Đúng |
Loại sự kiện: | ChuộtSự kiện |
Thẻ HTML: | Tất cả các phần tử HTML, NGOẠI TRỪ: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style> và <title> |
Phiên bản DOM: | Sự kiện cấp 2 |
Hỗ trợ trình duyệt
onmouseup
là tính năng DOM cấp 2 (2001).
Nó được hỗ trợ đầy đủ trong tất cả các trình duyệt:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 9-11 |