怎么让select下的option选中 发布时间:2023/10/11 select option 这里以默认选中性别为例: HTML文件: <select name="sex" id="sex"> <option value="1">男</option> <option value="2">女</option> </select>复制代码 jQuery方法 $(function(){ $("#sex").find("option[value = '"+值+"']").attr("selected","selected"); }) $("#sex").find("option:contains('男')").attr("selected", true); 亲测可用复制代码 JS方法: function fun(){ document.getElementById("sex").value = 2; }复制代码