HTML onmouseup Attribute

HTML onmouseup Attribute: This attribute is defined as it fires when a mouse button is released over the element. While the order of events occurs related to the onmouseup event.

  • onmousedown
  • onmouseup
  • onclick

HTML onmouseup Attribute

This attribute can be applied to all the HTML elements.

Attribute Value: This attribute contains a single value script and it works when onmouseup attribute called.



Syntax: <element onmouseup = “script”>

Browser Support:

This attribute is supported by the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Opera
  • Internet Explorer

Example: for <p> element

<!DOCTYPE html> 
<html> 
  <head> 
     <title>onmouseup event attribute</title> 
   <style> 
  h1 { 
  color:green; 
  } 
    body { 
  text-align:center; 
  } 
   </style> 
  </head> 
     <body> 
  <center> 
  <h1>Freshersnow</h1> 
  <h2>onmouseup event attribute</h2> 
  <p id="gfg" onmouseup="mouseUp()"> 
        Freshersnow: ! computer science portal for freshers 
  </p> 
  <script> 
      function mouseUp() { 
      document.getElementById("gfg").style.color = "green"; 
      document.getElementById("gfg").style.fontSize = "20px"; 
     } 
  </script> 
  </body> 
</html>

Output:

BEFORE

HTML onmouseup attribute

AFTER RIGHT CLICKING ON MOUSE BUTTON

HTML onmouseup event attribute