Sublime Text
<!DOCTYPE html> <html> <body> <progress max="10" value="0" id="tientrinh"></progress> <button onclick="myFunction()">Bắt đầu</button> <script> var i = 1; function myFunction() { setTimeout(function () { document.getElementById("tientrinh").value = i; i++; if (i <= 10) { myFunction(); } }, 1000) } </script> </body> </html>
<!DOCTYPE html> <html> <body> <progress max="10" value="0" id="tientrinh"></progress> <button onclick="myFunction()">Bắt đầu</button> <script> var i = 1; function myFunction() { setTimeout(function () { document.getElementById("tientrinh").value = i; i++; if (i <= 10) { myFunction(); } }, 1000) } </script> </body> </html>