解决方案 »
- 谁能给说说Ext中panel和viewPort的区别?
- 求一个js日期时间控件,我有一个例子,但功能不能实现
- javascript nicEdit 哪位可以解释一下这段代码
- 一个页面查找和标注JS代码分析?
- 给网页关键字加链接 自定义网页关键字连接代码?
- 本人想学习 JavaScript 高手们推荐们书啊!!
- 100分, 问一个高难度的问题。
- 请教如何实现在一个按钮上触发的事件:1.单击第一次改变按钮的value值 2.单击第二次弹出新窗口?
- table中,单击其中一行时,该行变红色,点另外一行时,另外一行变红色,只有一行被聚焦,
- <a href=mailto:[email protected]?subject="主题"&body="内容">发邮件</a>
- 循环滚动条javascript脚本,遇到多表嵌套时候的问题
- 网络记事本 怎么实现的
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script>
window.onload = function() {
var aa = "";
var count = document.getElementById('sel').options.length;
document.getElementById('sel').onchange = function() {
for(var i=0;i<count;i++) {
if(document.getElementById('sel').options[i].selected) {
aa += document.getElementById('sel').options[i].text;
alert(aa);
}
}
}
}
</script>
</head>
<body>
<select id="sel">
<option value="11">11</option>
<option value="22">22</option>
<option value="33">33</option>
</select>
</body>
</html>
这个试试看看~~~
document.form1.sauce.options[i].selected.text这句话有错误吧?
document.form1.sauce.options[i].selected返回一个布尔值,后面的.text肯定回报错的
楼主的意思是document.form1.sauce.options[i].text吧