Why this code don't work well? I need that every time you click the button the progressbar increase 20% but it don't do nothing.
js: ... function aaa() { } function qq() { let pre=document.querySelector("#pre"); var i=100; let id=setInterval(function(){ i-=20; if(i>=0){ pre.value=i} else { clearInterval(id); if (aaa()) { pre.value=i+=40; } } },1000); }; html: <p id="we">Sueño</p> <button id="me" onclick="aaa()">Dormir</button><progress value="100" max="100" id="pre"></progress> ////I need that every time you click the button the progressbar increase 20%