Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

for loop wont trigger innerHTML

I have an array thats running trough a for loop and entering data into a sqldb. Now i wanna show a progress bar but neither the innerHTML nor the .style.display = "block" thats before the for loop would trigger.

loader.style.display = "block";
for (var i=1; i<array.length; i++) {
    loadingState.innerHTML = i+1;
    if( array[i] != '' ) {
        //db-entry
        );
    }
};

I have tried this with forEach, $.each and with a for loop now. Wont work at all. If i use a return; after the loop it shows me the final step of the progression. But while the loop is running nothing happens.

Anyone got an idea why this happens?

Comments