Switch to full style
JavaScript code examples
Post a reply

Sleep in Javascript

Tue Jan 08, 2013 10:09 pm

Timeout after fours seconds in javascript
javascript code
<html>
<head>
<title>Sleep in Javascript</title>


<script>
function fun1() {

setTimeout('fun2()', 4000);
}
function fun2() {
alert('After Sleeping to 4 seconds');

}
</script>
<style type="text/css">
div#divMe
{
font-weight:bold;
background:#0000C0;
visibility:visible;
text-align:center;
text-decoration: underline;
color:Yellow;
}
</style>

</head>

<body>
<input type="button" onclick="fun1()" value="Sleep" />
<div id="divMe">
<p>Sleep for sometime in Javascript</p>
</div>
</body>
</html>




Post a reply
  Related Posts  to : Sleep in Javascript
 javascript help with BMI     -  
 i need help in javascript     -  
 Javascript     -  
 When to use javascript?     -  
 need help in javascript     -  
 using javascript     -  
 need help with javascript     -  
 what is javascript ?     -  
 JavaScript     -  
 JavaScript array_map     -  

Topic Tags

JavaScript Functions