fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> <script> function displayResult(){ document.getElementById("orange").selected=true; } </script> </head> <body> <form> 选择你最喜欢的水果: <select> <option id="apple">Apple</option> <option id="orange">Orange</option> <option id="pineapple" selected="selected">Pineapple</option> <option id="banana">Banana</option> </select> </form> <button type="button" onclick="displayResult()">选择 Orange</button> </body> </html>
运行结果