<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>给select赋值</title> <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script> <style type="text/css"> *{ margin: 0; padding: 0; } select{ margin-top: 100px; display: block; margin: 0 auto; width: 300px; height: 50px; font-size: 18px; } </style> </head> <body> <div style="margin-top:100px;"></div> <select id="testSelect"> <option value ="">请选择</option> <option value ="中">中1</option> <option value ="国">国1</option> <option value ="人">人1</option> <option value ="民">民1</option> <option value ="解">解1</option> <option value ="放">放1</option> <option value ="军">军1</option> </select> </body> <script type="text/javascript"> $("#testSelect").on("change",function(){ var val = $('#testSelect option:selected').val();//选中的value值 alert(val) var aa = $("#testSelect option:selected").text(); //获取选中的option的文本值 alert(aa) }); $("select option[value='解']").attr("selected",true); </script> </html>