Pause on hover of next button - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Button

Description

Pause on hover of next button

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
var t;//from   w  w w .ja  v  a  2s .co  m
function startTimer()
{
    t = setInterval(simulateClick, 2000);
}
function stopTimer()
{
    clearInterval(t);
}
function simulateClick()
{
    console.log("Simulate click");
}

      </script> 
   </head> 
   <body> 
      <input type="button" value="Start" onclick="startTimer()"> 
      <input type="button" value="Stop" onclick="stopTimer()">  
   </body>
</html>

Related Tutorials