Tryit Editor v1.4

<html> <head> <script> function startEQ() { richter=5; parent.moveBy(0,richter); parent.moveBy(0,-richter); parent.moveBy(richter,0); parent.moveBy(-richter,0); timer=setTimeout("startEQ()",10); } function stopEQ() { clearTimeout(timer); } </script> </head> <body> <form> <input type="button" onclick="startEQ()" value="Start an earthquake"> <br /> <br /> <input type="button" onclick="stopEQ()" value="Stop the earthquake"> </form> </body> </html> | Your Result:
Edit the code above and click to see the result. | W3Schools.com - Try it yourself