Skip to content Skip to sidebar Skip to footer

How To Set Percentage In Javascript For My Progress Bar?

I do not know anything in Javascript (I have copied a code for a progress bar but it does not display the percentage). I just need to display the text value of the actual % inside

Solution 1:

https://developer.mozilla.org/en/DOM/element.innerHTML -- this is the element property to set the content of an element.

Assuming your progress percentage is defined as var percent, you'll just need to set the content as such:

progress.innerHTML = percent.toFixed(1) + '%';

Solution 2:

Instead of this, you may try Query Loader.

This preloader has it all. Loading bar, custom animations and getting all images included in the web page.

You can see a demo here

Post a Comment for "How To Set Percentage In Javascript For My Progress Bar?"