Window.onmouseup

This article is in need of a technical review.

Summary

An event handler for the mouseup event on the window.

Syntax

window.onmouseup = funcRef;
  • funcRef is a reference to a function.

Example

window.onmouseup = doFunc;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>onmouseup test</title>

<script>
window.onmouseup = mouseup;

function mouseup() {
  alert("mouseup event detected!");
}
</script>
</head>

<body>
<p>click on the page with the LH mouse button, and hold down for a few
seconds, then release the button. The mouseup event fires when you
release the mouse button.</p>
</body>
</html>

Notes

The mouseup event is raised when the user unclicks the mouse button anywhere in the document.

Specification

Not part of specification.

Document Tags and Contributors

Contributors to this page: Sheppy, GavinSharp, ziyunfei, teoli, ethertank, Rappo, Jabez, kscarfone, Mgjbot
Last updated by: teoli,
Hide Sidebar