Introduction :-
Hii Friends..
Today I explain how to make a timer with a popup message with the help of Java-Script. At the end when time is up the popup box show a message that your time has been out. So here I explain this step by step.
Step:1 The designing code goes here.
<html>
<center>
<p><font color="#005500" style="font-size:30px;"><i>Your time left </i></font></p><input type ="text" id=start disabled>
<br>
<p><font color="#005500" style="font-size:30px;"><i>Ending time is=10 sec </i></font></p>
<script type="text/javascript">
var a=10;
function time()
{
document.getElementById('start').value=a;
a--;
if(a==0)
{
alert('time is up');
window.close();
}
setTimeout("time()",1000);
}
time();
</script>
</center>
</html>
Demo :-
Hii Friends..
Today I explain how to make a timer with a popup message with the help of Java-Script. At the end when time is up the popup box show a message that your time has been out. So here I explain this step by step.
Step:1 The designing code goes here.
<html>
<center>
<p><font color="#005500" style="font-size:30px;"><i>Your time left </i></font></p><input type ="text" id=start disabled>
<br>
<p><font color="#005500" style="font-size:30px;"><i>Ending time is=10 sec </i></font></p>
<script type="text/javascript">
var a=10;
function time()
{
document.getElementById('start').value=a;
a--;
if(a==0)
{
alert('time is up');
window.close();
}
setTimeout("time()",1000);
}
time();
</script>
</center>
</html>
Demo :-
0 comments:
Post a Comment