+ 1
Why isnt the progress bar not loading
5 odpowiedzi
+ 2
You haven't linked Javascript to your html which is why pro() method is not getting any value to display.
+ 2
You can define the pro() method as follows in Javascript section-
window.onload = pro()
{
//method contents here.
}
And maybe you can have a while loop so as to stop once you reach 100%.
+ 1
window.onload = function() {
var pos = 0;
var bar = document.getElementById('p1');
var t = setInterval(move, 50);
function move() {
if(pos >= 100) {
clearInterval(t);
}
else {
pos += 1;
bar.value= pos;
}
}
};
And on the html section, add id=p1 to progress tag.
<progress id='p1'min="0" max="100" value="pro()">
You should be good.
0
Butbi used the return statement
0
If tried to make the return statement in the while loop but still not wotking