如何获取下拉列表里选中值的索引 当选中的时候获取索引,进行逻辑删除。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.cftea.com/c/753.asp function ChangeList() {var obj = document.getElementById("List");var strOptionValue = obj[obj.selectedIndex].value;var strOptionText = obj[obj.selectedIndex].text;alert(obj.selectedIndex);}<html:select property="List" size="1" onchange ="ChangeList()"> 同意三楼。。<html><head><title>如何获取下拉列表里选中值的索引</title><script type="text/javascript"> function changeSel(){ var sel = document.getElementById("sel"); alert(sel.selectedIndex); }</script></head><body><form id="form1" action="#" method="post"> <select id="sel" onchange="changeSel()"> <option value="0">首页</option> <option value="1">资讯</option> <option value="2">移动</option> <option value="3">云计算</option> </select></form></body></html> 怎么用一条sql语句把学生的分数都列出来 javamail 不通过邮箱 发送信息 求助!一个页面读取的编码问题! 高手帮个忙 jive的疑问 hibernate怎么求两列相乘之和呢 没钱了,20分请教一个问题,急!! 我的第一个ejb搞不定啊!??!帮帮我!(从servlet调用ejb有问题) 利用Struts的tag写的jsp的问题 请教在MVC的struts结构下,怎样在ACTION里实现文件上传。。谢谢 页面导出Excel问题 'jar' 不是内部或外部命令,也不是可运行的程序怎么解决 spring问题,在一个类上面注释了@service是什么意思?
function ChangeList() {
var obj = document.getElementById("List");
var strOptionValue = obj[obj.selectedIndex].value;
var strOptionText = obj[obj.selectedIndex].text;
alert(obj.selectedIndex);
}
<html:select property="List" size="1" onchange ="ChangeList()">
<html>
<head>
<title>如何获取下拉列表里选中值的索引</title><script type="text/javascript">
function changeSel(){
var sel = document.getElementById("sel");
alert(sel.selectedIndex);
}
</script>
</head><body>
<form id="form1" action="#" method="post">
<select id="sel" onchange="changeSel()">
<option value="0">首页</option>
<option value="1">资讯</option>
<option value="2">移动</option>
<option value="3">云计算</option>
</select>
</form>
</body>
</html>