您的位置:首页 > 其它

meter度量值,也可用作进度条

2016-06-10 13:30 260 查看
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>

<input type="button" value="点击" onclick="btn()">
<meter value="0" max="100" min="0" low="20" high="30" id="p" style="width:200px;height:10px;"></meter><span>0</span>%
</body>

<script>
function btn(){
var i=1;
function xiugai(){
if(i<100){
i++;
updateV(i);
}
}
setInterval(xiugai, 100);
}

function updateV(v){
var p=document.getElementById("p");
p.value=v;
var span=document.getElementsByTagName("span")[0].textContent=v;
}
</script>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: