js函数方法: Demo: 不知道还有没有更方便快捷的方法,曾尝试通过jQuery获取$('#sel option[defaultSelected]'),可一直返回空。 各位园友,我要的是select控件初始化的值,非select当前选中的值,初始化的值不随 ...
var sel document.getElementsByName paydate var selvalue sel.options sel.options.selectedIndex .value 你要的值 var seltext sel.options sel.options.selectedIndex .innerHTML 你要的文本 ...
2013-01-08 17:35 0 4735 推荐指数:
js函数方法: Demo: 不知道还有没有更方便快捷的方法,曾尝试通过jQuery获取$('#sel option[defaultSelected]'),可一直返回空。 各位园友,我要的是select控件初始化的值,非select当前选中的值,初始化的值不随 ...
实际代码:var checkUserSelect=$("#checkUserSelect option:selected").text();//执法人员姓名 jQuery中获得选中select值第一种方式$('#testSelect option:selected').text ...
JS: Jquery: ...
JS: Jquery: ...
如果前台是静态加载的下拉框,那么后台ASP.NET 后台获取的时候用Request["SelectId"] 即可获取到所选取的值, 如果要获取到文本,则需要通过隐藏文本框保存后后台才可获得。 ...
一、js获取select标签选中的值var obj = document.getElementById(”testSelect”); //定位id var index = obj.selectedIndex; // 选中索引 var text = obj.options[index].text ...
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>js</title></head>< ...