fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> <script> function getLength(){ alert(document.getElementById("mySelect").length); } </script> </head> <body> <form> <select id="mySelect"> <option>苹果</option> <option>梨子</option> <option>香蕉</option> <option>橙子</option> </select> <input type="button" onclick="getLength()" value="列表有几种选择?"> </form> </body> </html>
运行结果