手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >js获取select选中的option的text示例代码
js获取select选中的option的text示例代码
摘要:javascript复制代码代码如下:varitem=document.getElementById("");vartext=item.op...

javascript

复制代码 代码如下:

var item = document.getElementById("");

var text = item.options[item.selectedIndex].text;

jQuery

复制代码 代码如下:

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

【js获取select选中的option的text示例代码】相关文章:

javascript的事件描述

js去除字符串里中文与空格的例子

JavaScipt中Function()函数的使用教程

javascript中this的四种用法

Javascript随机显示图片的源代码

浅谈javascript中for in 和 for each in的区别

js获取页面description的方法

光标定位等TextRange的操作的范例代码

js实现异步循环实现代码

详谈javascript中的cookie

精品推荐
分类导航