if you see above code , i made function AutoChangeImage() to change image but i need it should be change image after 2 second and i used for loop to delay it for 2 second
for(d=0;d<=2000;d++){
//delay
}
i am thinking each iteration take one millisecond .
i do not think its good way to use for loop to delay it .not good at JavaScript so suggest something more better
Read more