首页上一页 1  下一页尾页 1 条记录 1/1页
        progress元素
                 	
                        发表在其他语言图书答疑区
                        2016-08-22                                                
                    		
                                                                            	
                        
                        
                    
                    
                    	是否精华
                    	是
                    	否
                    
                    
                    
                            版块置顶:
                            是
                            否
                        
                    <!DOCTYPE html>
<meta charset="UTF-8"/>
<title>progress元素的使用示例</title>
<script>
var progressBar = document.getElementById('p');
function button_onclick()
{
var progressBar = document.getElementById('p');
progressBar.getElementsByTagName('span')[0].textContent ="0";//
for(var i=0;i<=100;i++)
updateProgress(i);//
}
function updateProgress(newValue)
{
var progressBar = document.getElementById('p');
progressBar.value = newValue;
progressBar.getElementsByTagName('span')[0].textContent = newValue;//
}
</script>
<section>
<h2>progress元素的使用实例</h2>
<p>完成百分比: <progress id="p" max=100><span>0</span>%</progress></p>
<input type="button" onclick="button_onclick()" value="请点击"/>
</section>
帮我在双斜杠后面添加一下注释,多谢了。
特别是文中 get.ElementByTagName是什么意思还有后面的[0]以及textContent分别代表了什么意思?

 
	
                                                 VIP会员
VIP会员 购物车
购物车


 私信
                         私信 
                     发表新帖
发表新帖 立即签到
立即签到 
        		  
        		 
         		 关注
关注
                  回复
 回复 支持(
                	支持( 反对(
                    反对( 
               			  
                







 
                     
                     
					 
						 
						 
						 
						