onmousedown and onmouseup event



Write a javascript code to implement onmouseup and onmousedown Event .

<html>
  <head>
    <title>Mouse Demo</title>
      <script>

        function up()
        {
            document.frm1.b1.value="Mouse up";
        }
        function down()
        {
            document.frm1.b1.value="Mouse down";
        }

      </script>
    </head>
  <body>
  
<form name="frm1">

      <input type="button" name="b1" value="click" onmouseup="up()" onmousedown="down()">
       
  </form>        
</body>
</html>

Output: