HTML
CSS
JavaScript
Vue
React
Python
PHP
Java
.Net
Java9手册
PHP手册
CSS3手册
jQuery手册
源代码
在线运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>代码学院(codexy.cn)</title> <script> function changeText(){ var x=document.getElementById("mySelect"); x.options[x.selectedIndex].text="甜瓜"; } </script> </head> <body> <form> 选择你最喜欢的水果: <select id="mySelect"> <option>苹果</option> <option>橙子</option> <option>菠萝</option> <option>香蕉</option> </select> <br><br> <input type="button" onclick="changeText()" value="设置你的选项"> </form> </body> </html>
动行结果