Skip to content
Advertisement

Tag: while-loop

Always calculate var Javascript

I’m trying to show a variable on a html page that should always recalculating itself. And in my HTML, I have a div showing the x variable. But when the while loop is working, I can’t click on any other button. How can I always calculate the x variable (until the user closes the page) but still being able to

Create a pause inside a while loop in Javascript

I would like to create a pause inside a while loop so that I can create n animations that each appear 3 seconds after the other. I’ve tried the following, but it doesn’t work. Would love to have someone show me what I’m doing wrong. Answer setTimeout does not pause; it asks Javascript to run some other code later. Googling

Advertisement