Tue Jan 08, 2013 10:09 pm
<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>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.