<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
I want to set the data-max of my progress bar to zero but doing this causes the progress bar to count until infinity (100 divided by zero). How can I set my progress bar to zero?Here is my HTML:
<progress class="progressbar" value="0" max="100" data-max="1"></progress>
I link to jquery and modernizr.
Here is my javascript:
$(document).ready(function() {
$('.progressbar').each(function() {
var progressbar = $(this),
progressbarValue = progressbar.next(),
value = progressbar.data('min') || 0,
max = progressbar.data('max'),
time = (100 / max) * 5,
value = progressbar.val(),
animate = setInterval(loading, time);
function loading() {
value += 1;
progressbar.val(value);
progressbarValue.html(value + '%');
if (value == max) {
clearInterval(animate);
}
};
})
});