<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jQuery UI 測試</title> <script src="jquery.min.js"></script> <script src="jquery-ui.min.js"></script> <link id="theme" href="themes/hot-sneaks/jquery-ui.min.css" rel="stylesheet"> <style> body { font-family: 微軟正黑體, Arial, Helvetica, sans-serif; font-size:12px; } </style> </head> <body> <select id="language"> <option value="">最擅長的程式語言</option> <option value="C">C</option> <option value="R">R</option> <option value="Java">Java</option> <option value="Python">Python</option> <option value="Javascript">Javascript</option> </select> <script> $(document).ready(function(){ $("#language").selectmenu(); $('#language').on('selectmenuchange', function() { var language=$(this).val(); alert("您擅長的程式語言是 : " + language); }); }); </script> </body> </html>