getElementById在IE和FireFox浏览器中的区别
来源:互联网 发布:windows 7破解 编辑:程序博客网 时间:2024/05/22 07:01
JS代码:
function GoToList(){ //var partID=document.getElementById('SelectClassId').selectedOptions[0].value;//此语句在IE中无法正常取值,但在非IE中正常 //以下为通用方法: var a=document.getElementById("SelectClassId");//从document对象中,获取select标签 var partID=a.options[a.selectedIndex].value;//select标签获取的值其实是一个数组--a.options[]; 然后,选定项的下标是--a.selectedIndex //document.write(partID); var Url="SelectPart.asp?Pid="+partID; window.location.href=Url;}
HTML代码:
<select id="SelectClassId" name="SelectClassId"> <option value="1">分类一</option> <option value="2">分类二</option> <option value="3">分类三</option> <option value="4">分类四</option> <option value="5">分类五</option></select><input type="button" id="Sure" name="Sure" value="确认" onclick="GoToList()" />
0 0
- getElementById在IE和FireFox浏览器中的区别
- getElementById在IE和FireFox下兼容问题
- Javascript在IE和FireFox中的区别
- JavaScript在IE浏览器和Firefox浏览器中的差异总结
- firefox和ie中getElementById方法的区别
- IE和firefox浏览器在网页编程方面的区别
- jQuery:append 和 appendTo 在firefox和ie中的区别
- getElementById在ie可以firefox怎么不起作用
- javascript事件处理在IE和FireFox中的区别
- javascript事件处理在IE和FireFox中的区别
- js在firefox和ie中的区别(一)
- js在firefox和ie中的区别(二)
- CSS、Javascript在IE和Firefox中的区别
- IE中的getElementById和getelementsbyname
- javascript 在IE与firefox中的区别
- CSS在IE与firefox中的区别
- firefox浏览器和IE
- 整理的比较全的event对像在ie与firefox浏览器中的区别
- Session和Application的区别。
- CentOS_7 OpenWrt Eclipse 环境搭建
- 【易语言助手插件】IDE 鼠标手势1.2 原汁原味移植浏览器手势
- Python读取大文件的最后N行
- 【HDU3401】Trade
- getElementById在IE和FireFox浏览器中的区别
- 新浪前端开发实习面经
- Java设计模式——代理模式(静态代理vs动态代理)
- 总结eclipse中安装maven插件
- Linux EMMC子系统分析-初始化流程(转载)
- ReactJS学习系列课程(React 组件的组合使用)
- 本萌新作 Ecode Archives
- 敏捷软件开发(上篇)
- CMD下请求UAC提权,而不需要右键以管理员模式运行