Hello, I really need some help including this in a function. The function has a getElement by ID in it and thats whats throwing me off. The id calls on the nowDate and works just fine. Thing is I need to add
setTimeout(‘function()’,1000) to it somehow.
If I try to add the changeImg function to set Timout, within the changeImg function, as its usually done it won’t work due to the id element being in the function as well. I don’t know the best way to incorporate the setTimout so that when the id element is called it will utilize the set timeout along with the nowDate. Hope someone can help, heres the info. Thank you very much.
now = new Date()
nowDate = now.getMinutes()
function changeImg(){
document.getElementById(“img”).src = arr[nowDate-1][0];
}