<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jQuery</title> <script src="jquery-3.3.1.min.js"></script> </head> <body> <script type="text/javascript"> $(function(){ // 按钮单击时执行 $("#btnInfo").click(function() { // 获取select选中的text alert($("#ddlInfo").find("option:selected").text()); // 获取select选中的value alert($("#ddlInfo ").val()); // 获取select选中的索引: alert($("#ddlInfo ").get(0).selectedIndex); // 设置select选中的索引 $("#ddlInfo ").get(0).selectedIndex = 1; //index为索引值 }); }) </script> <div class="divInfo"> <select id="ddlInfo"> <option value="jzh">jzh</option> <option value="chanpinxue.cn">idodo</option> </select> </div> <button id="btnInfo" type="button">jQuery</button> </body> </html>