网络编程
位置:首页>> 网络编程>> JavaScript>> js获取select选中的option的text示例代码

js获取select选中的option的text示例代码

  发布时间:2024-04-19 09:58:48 

标签:select,option

javascript


var item = document.getElementById("");
var text = item.options[item.selectedIndex].text;


jQuery


var text = $("#selector")[0].options[$("#selector")[0].selectedIndex].text
0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com