html - Date in Javascript Div loop not updating correctly -
i'm trying generate 3 divs in loop , insert datetime in each iteration . problem i'm running while function generates 3 div's correctly appends same time 3 div's leaving me (javascript newbie) believe date() function being executed once . if explain me going on appreciate it. ideally replace date function graph's , have graph load in each div.
function gengraphs () { (i=0; < 3; ++i) { var divtag = document.createelement("div"); divtag.style.width ="1000px"; divtag.style.height ="600px"; divtag.id = "graph"+i; document.body.appendchild(divtag); divtag.innerhtml = date(); // divtag.appendchild(getgraph(divtag)); // divtag.innerhtml = getgraph(divtag); } }
the server executing script fast enough (in milliseconds) date() returned not visibly different. try delay or use increment variable i
Comments
Post a Comment