var t = 0;
function addDiv()
{
    var div = document.createElement("div");
    t++;
    div.setAttribute("id", "box" + t);
    document.body.appendChild(div);
    AddStyle();
}
var h = 0;
var p = 1;    
function doMove()
{
    var okj = document.getElementById("box" + p);
    if (p <= t) {
        p++; 
    }
    var g = setInterval(function () {
        var go = parseInt(okj.style.left, 0) + 1 + "px";
        okj.style.left = go;
    }, 1000 / 60);
}
My question is that after the p increments that is p++ will my var p = 1 be incremented everytime I call doMove? Please help me regarding this matter.
 
    