I’m using this code for my web assignment:
http://csstechniques.blogspot.sg/2007/05/super-simple-css-bars.html
But how do I show the percentage of the bar outside the progress bar like so:
?
I’ve tried many ways & it is driving me nuts. I’ve also googled but most results comes up using jQuery, which I’m not supposed to use for my assignment (only CSS, HTML and PHP).
Many thanks in advance for the help.
your html is like this:
you will need additional elements to show the percentage text like so:
Then you can query the percentage-number element and change the text with JavaScript like so:
Check out querySelector, querySelectorAll, getElementById, getElementsByTagName, etc. in the MDN documentation. That will help you quite a bit with this. By the way, querySelector and querySelectorAll only work in modern browsers (incl. IE8+). That’s one of the reasons why people use jQuery to do this stuff.