Mouseevents using inline Javascript

I need an example where i can use inline Javascript functions for mouse events

Add Comment
  • 1 Answer(s)
      
      <!doctype html>
      
      <html>
      
      <head>
      
      <meta charset="utf-8">
      
      <title>Mouse Events</title>
      <style type="text/css">
      
      p{
      
      width:150px;
      
      height:40px;
      
      background-color:#efefef;
      
      }
      </style>
      
      <script type="text/javascript">
      function testScript(){
      
      cc = document.getElementById('demo');
      
      }
      function sruthiMover(){
      
      cc.style.backgroundColor ="#ffff00";
      
      }
      function sruthiMout(){
      
      cc.style.backgroundColor ="#ff0000";
      
      }
      function sruthiClick(){
      
      }
      </script>
      </head>
      <body onLoad="testScript()">
      <p id="demo" onMouseOver="sruthiMover()" onMouseOut="sruthiMout()" onClick="sruthiClick()">sdfasdgsadfsd</p>
      </body>
      
      </html>
      
      Kid Answered on March 7, 2016.
      Add Comment

      Your Answer

      By posting your answer, you agree to the privacy policy and terms of service.