<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>进度条</title> </head> <body> <progress value="0" max="100" id="pro"></progress> <script> var t = 0; var pro = document.getElementById('pro'); function jindu() { var v = pro.value; if(v<100){ pro.value+=20; }else clearInterval(t); } t=setInterval(jindu,100) </script> </body> </html>