Reset html5 progress bar

How do I reset an HTML5 progress bar back with Javacript to its original look after it's been used?
StarDusterIIAsked:
Who is Participating?
 
StarDusterIIConnect With a Mentor Author Commented:
Apparently, you can't reset the progress bar too soon.  I set a timer for a couple of seconds after the file had uploaded and then:

progress.value = progress.innerHTML = 0;

That worked.
0
 
GaryCommented:
How are you setting it?  Should be just a simple case of setting the value with javascript.
0
 
StarDusterIIAuthor Commented:
Not really setting it with anything.  The only thing I have in css is progress { width: 100%; }

So, what value to set?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
GaryCommented:
Then it should just  be a case of - are you using jquery?

$("#progress-bar-id").val("0")
0
 
StarDusterIIAuthor Commented:
Not using jquery.  Here's what I'm using.  Basically, the progress bar is colored as the file is uploaded and when it's finished, I can't get the color back to it's original color.

<progress id="uploadprogress" min="0" max="100" value="0"></progress>
progress = document.getElementById('uploadprogress')
...
var complete = (event.loaded / event.total * 100 | 0);
progress.value = progress.innerHTML = complete;
...
progress.value = progress.innerHTML = 0;

Open in new window

0
 
StarDusterIIAuthor Commented:
It was the timer that made it work.  You can't reset too soon and no one mentioned that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.