html代码:
<select id="myid"> <option value ="1">one</option> <option value ="2">two</option> <option value="3">three</option> <option value="4">four</option> </select>
js代码:
var myId = $("#myid").val(); // 获取select value值 var myIdName = $("#myid option:checked").text(); // 获取select 显示值
原文地址:https://www.cnblogs.com/woods1815/p/11371524.html
时间: 2024-10-11 11:59:46