Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Time Counter With JQuery
WhatsApp
Satyajeet Kumar
Mar 19
2016
1.3
k
0
0
<span id=
"Span2"
style=
"float: left; padding-left: 10px; padding-right: 5px;"
>
If you did not received One-Time Password (OTP)</span> <span id=
"pleaseWait"
style=
"float: left;"
>Please wait <span id=
"timeCount"
>120</span> seconds.</span> <span id=
"Span1"
style=
"display: none; float: left; padding-top: 2px;"
>
<script src=
"js/jquery-1.7.1.min.js"
></script>
<script type=
"text/javascript"
>
window.onload = function(){
(function(){
var counter = 120;
setInterval(function() {
counter--;
if
(counter >= 0) {
span = document.getElementById(
"timeCount"
);
span.innerHTML = counter;
}
// Display 'counter' wherever you want to display it.
if
(counter === 0) {
document.getElementById(
'pleaseWait'
).style.display =
'none'
;
document.getElementById(
'Span1'
).style.display =
'block'
;
}
}, 1000);
})();
}
</script>
TIME COUNTER
TIMER
JQUERY TIMER
Up Next
Time Counter With JQuery