I cam across this code that was like a login timer e.g. if the login credentials were wrong, a timer of 5 seconds would be appear till next login and then if you fail again it would go up to like 15. Would you guys know how it's done?
Thank you.
.......( document ).ready( function() {
(function(){
var lTimeoutField = document.getElementById("throttle_sec"),
lTimeout = lTimeoutField ? +lTimeoutField.innerHTML : 0;
if (lTimeout) {
var lTimer = window.setInterval (
function() {
if (lTimeout > 0) {
lTimeoutField.innerHTML = lTimeout;
lTimeout--;
} else {
window.clearInterval(lTimer);
var lDiv = document.getElementById("throttle_div");
if (lDiv) {
lDiv.parentNode.removeChild(lDiv);
return true;
}
}
},
1000 );
}})();