fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <form> <select id="pets"> <option>Cats</option> <option>Dogs</option> </select> </form> <p>单击下面的按钮禁用下拉列表。</p> <button onclick="disableElement()">禁用下拉列表</button> <script> function disableElement(){ document.getElementById("pets").disabled=true; } </script> </body> </html>
运行结果