VOOZH about

URL: https://www.geeksforgeeks.org/html/html-dom-onmouseup-event/

⇱ HTML DOM onmouseup Event - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML DOM onmouseup Event

Last Updated : 15 Jun, 2023

The HTML DOM onmouseup event occurs on the release of a pressed button on a mouse over an element.

Related events for left-click: 

  • onmousedown
  • onmouseup
  • onclick

Related events for right-click: 

  • onmousedown
  • onmouseup
  • oncontextmenu

Supported Tags: It supports All HTML elements, EXCEPT:

  • <base>
  • <bdo>
  • <br>
  • <head>
  • <html>
  • <iframe>
  • <meta>
  • <param>
  • <script>
  • <style>
  • <title>

Syntax: 

  • In HTML:  
<element onmouseup="myScript">
  • In JavaScript:  
object.onmouseup = function(){myScript};
  • In JavaScript, using the addEventListener() method: 
object.addEventListener("mouseup", myScript);

Example: In this example, we will use the HTML DOM onmouseup event.

Output: 

👁 Image

Supported Browsers: The browsers supported by HTML DOM onmouseup Event are listed below: 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera
Comment