SetTimeout("fn(x)", interval) - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window setInterval

Description

SetTimeout("fn(x)", interval)

Demo Code

ResultView the demo in separate window

<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>

Related Tutorials