Add event handler for anchor link mouse up event in JavaScript

Description

The following code shows how to add event handler for anchor link mouse up event.

Example


<html>
<body>
  <script language="JavaScript">
    function function1() {<!--from   w  w w. j  av  a 2  s  .  c  o m-->
      var m = document.getElementById("myA");
      document.writeln(m.innerText);
    }
  </script>
  <p>Click in the following element:</p>
  <a id="myA" href="http://www.java2s.com" onclick="return(false);"
    onmouseup="function1();">This is a link </a>
</body>
</html>

Click to view the demo





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window