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