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


javascript
复制代码 代码如下:

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

jQuery
复制代码 代码如下:

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

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3