jquery或者javascript如何获取下拉列表框的文本值? <select id="sed"> <option value="1">张三</option></select>我现在要用js写拿到张三 不要他的value值 要文本值。JavaScriptjQueryselectoption 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 js: var tem = document.getElementById("sed"); alert(tem.options[tem.selectedIndex].text)jquery: alert($("#sed option:selected").text()); <html><head><script>function show(){ var sed=document.getElementById("sed"); var txt=sed.options[sed.selectedIndex].innerText; alert(txt);}</script></head><body ><select id="sed" onchange="show()"> <option value="1" selected>张三</option><option value="2">李四</option><option value="3">王五</option> </select></body></html> JQUERYencodeURIComponent($("#ddlProductType").find('option:selected').text())如果作为参数传递需要编码。 jquery不起作用,头疼 jquery选择器的问题..求解 一個有趣的站,問他的加密技術 要发疯了。。。。 如何用 js 打开 _blank 链接? 关于多级联动菜单的问题(部分代码) 请问如何通过javascript脚本,把一个<div>层固定在屏幕右上角,谢谢! 求助 请教个关于变量的问题. 如何制作一个简单的滚动新闻? 急....急.....急 $.post 第一个参数多出[] 不知道为啥
var tem = document.getElementById("sed");
alert(tem.options[tem.selectedIndex].text)
jquery:
alert($("#sed option:selected").text());
<html>
<head>
<script>
function show()
{
var sed=document.getElementById("sed");
var txt=sed.options[sed.selectedIndex].innerText;
alert(txt);
}
</script>
</head>
<body >
<select id="sed" onchange="show()">
<option value="1" selected>张三</option>
<option value="2">李四</option>
<option value="3">王五</option>
</select>
</body>
</html>