案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h3>演示如何创建 METER 元素</h3>
6
7
<p>点击按钮来创建包含指定值的 METER 元素。</p>
8
9
<button onclick="myFunction()">试一下</button>
10
11
<p><b>注释:</b>Internet Explorer 以及 Safari 5(以及更早的版本)不支持 value 属性。</p>
12
13
<script>
14
function myFunction()
15
{
16
var x = document.createElement("METER");
17
x.setAttribute("min", "0");
18
x.setAttribute("max", "100");
19
x.setAttribute("value", "65");
20
document.body.appendChild(x);
21
}
22
</script>
23
24
</body>
25
</html>
26