- <!DOCTYPE html>
- <html>
- <script type="text/javascript">
- var i=0;
- function barProcess(){
- i+=1;
- if(i<100){document.getElementById("bar").value=i;}else{alert("finish download");return;}
- setTimeout(barProcess,1000);
- }
- </script>
- <body>
- 下载进度:
- <progress id="bar" value="0" max="100">
- </progress>
- <button id='click' value='click' style="height:30px;width=100px;" onclick="return barProcess()"></button>
- <p><b>注释:</b>Internet Explorer 9 以及更早的版本不支持 <progress> 标签。</p>
- </body>
- </html>
- //该片段来自于http://www.codesnippet.cn/detail/230620149863.html
来源: http://www.codesnippet.cn/detail/230620149863.html