CKTIS / HTML
onmouseup — handling mouse button release
The global HTML attribute onmouseup contains JavaScript code that handles the mouseup event, associated with releasing a mouse button.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
onmouseup="JavaScript statements"onmouseup is a global event handler attribute available on HTML elements. It corresponds to the mouseup event: releasing a mouse button, rather than pressing it.
The attribute value is a JavaScript function body, not an event name or a script address. Inside the handler, event provides the event and this refers to the element handling it. In the example, this.textContent changes the button's text.
The HTML attribute onmouseup contains code text; the JavaScript property element.onmouseup accepts a function or null. These are two ways of setting the same handler. Content Security Policy can block handlers written directly in attributes.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>onmouseup example</title>
<button type="button" onmouseup="this.textContent = 'mouseup received'">Release here</button>
</html>Result
mouseup received
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.