编辑下面的代码:【加编码】
<html> <body> <form> Cats:<input type="checkbox" id="cats"><br> Dogs:<input type="checkbox" id="dogs"> </form> <p>Click the button below to disable the first checkbox above.</p> <button onclick="disableElement()">Disable checkbox</button> <script> function disableElement() { document.getElementById("cats").disabled=true; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂