编辑下面的代码:【加编码】
<html> <body> <h3>访问 METER 元素</h3> <p>Peter 的分数: <meter id="myMeter" min="0" low="40" high="95" max="100" value="65"></meter></p> <p>点击按钮获取上面度量的当前值。</p> <p id="demo"></p> <button onclick="myFunction()">尝试一下</button> <p><b>注意:</b>Internet Explorer 和 Safari 5(及其之前的版本)不支持 value 属性。</p> <script> function myFunction() { var x = document.getElementById("myMeter").value; document.getElementById("demo").innerHTML = x; }; </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂