如何取得下拉框 onchang之前的值 页面加载的时候就用全局变量保存 window.old_sel_value = sel.options[sel.selectedIndex].valueonchange 函数最后再保存下,随时可以取window.old_sel_value 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 随便写了一个,看看够用不?用动态属性实现,跟踪每次变化,至于初始值可以用 hookee() 的方法来实现。L@_@K<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> </head> <body> <select id="selCars" size="1"> <option value="0">- 请选择 -</option> <option value="1">宝马</option> <option value="2">保时捷</option> <option value="3">奔驰</option> </select> <div id="divOutput"> </div><script type="text/javascript"><!--var oOutput = document.getElementById("divOutput");var oSel = document.getElementById("selCars");oSel.onchange = function () { oOutput.innerHTML += "之前选中: " + this.options[this.previousSelectedIndex].text + " ; " + "当前选中: " + this.options[this.selectedIndex].text + ".<br />";};oSel.onfocus = function () { this.previousSelectedIndex = this.selectedIndex;};oSel.onclick = function () { this.previousSelectedIndex = this.selectedIndex;};oSel.onkeyup = function () { this.previousSelectedIndex = this.selectedIndex;};//--></script> </body></html> 更改JQ的滑动方向 怎么才能让幻灯片自动播放啊,能给一个思路吗? Extjs2布局及tabpanel问题 向高手求一个字符串的js 我一个框架里的某链接点击后出现登录,然后第一个框架中的主体跳到别一个框架中,该怎么做啊? JScript中,如何实现计算器 一个菜单切换的问题 判断特殊符号的正则表达式 怎么样实现类似csdn社区上的社区导航兰的功能 vue单页面应用总是先出现主页一闪而过的现象 在框架页面未加载完成前有没有办法让js停止执行? FireFox里用JS如何侦听如FlashPlayer这样的插件的事件消息?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<select id="selCars" size="1">
<option value="0">- 请选择 -</option>
<option value="1">宝马</option>
<option value="2">保时捷</option>
<option value="3">奔驰</option>
</select>
<div id="divOutput">
</div>
<script type="text/javascript">
<!--
var oOutput = document.getElementById("divOutput");
var oSel = document.getElementById("selCars");oSel.onchange = function ()
{
oOutput.innerHTML += "之前选中: " + this.options[this.previousSelectedIndex].text + " ; " + "当前选中: " + this.options[this.selectedIndex].text + ".<br />";
};oSel.onfocus = function ()
{
this.previousSelectedIndex = this.selectedIndex;
};oSel.onclick = function ()
{
this.previousSelectedIndex = this.selectedIndex;
};oSel.onkeyup = function ()
{
this.previousSelectedIndex = this.selectedIndex;
};//-->
</script>
</body>
</html>