Trying to display the values of my inner HTML, from 10 to 1, but am able to show only the value 1.
the values should display, one by one.. For example if 10 get displays, it should hide and then 9 should display, it just like a timer.
How to fix this, this is what I have tried.
HTML:
<div id='test'></div>
JS:
var a = 10;
var b=1;
var tar = document.getElementById('test');
for(var a=10;a>=b;a--){
tar.innerHTML = a;
if(a==b){
tar.innerHTML = a;
//tar.style.display='none';
window.location.href = "http://www.google.co.in";
}
}