Javascript examples for DOM HTML Element:Input Button
Pause on hover of next button
<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>