Javascript examples for Browser Object Model:Window setInterval
SetTimeout("fn(x)", interval)
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <script type="text/javascript"> var x = 0;//from w ww . j a va 2 s. c o m function testclear() { var t= setTimeout(' clearInterval(x)' ,1501); x = setInterval("console.log('hello, welcome');",500); } </script> <input id="txt" onchange="testclear()"> </body> </html>