js判断下拉框值是否改变 js怎么判断下拉框值选中的值是否改变? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在onchange里给一个全局变量flag赋值为true,button按钮的onclick事件显示就可以了嘛。。 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title></head> <body> <select id="select"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <button id="button">button</button> <script> var selector = document.getElementById('select'), index = selector.selectedIndex; button = document.getElementById('button'); button.onclick = function(){ var _index = selector.selectedIndex; if(_index !== index){ index = _index; alert('change'); }else{ alert('no change'); } } </script></body> </html> 是啊 ie确定买不了。我在chrome跑不了 var selector = document.getElementById('select'), index = selector.selectedIndex, button = document.getElementById('button'); button.onclick = function(){ var _index = selector.selectedIndex; if(_index !== index){ index = _index; alert('change'); }else{ alert('no change'); } }纯属手误,一个,号误打成;号了,话说你们都不会调试下么。。 var selector = document.getElementById('select'), index = selector.selectedIndex, button = document.getElementById('button'); button.onclick = function(){ var _index = selector.selectedIndex; if(_index !== index){ index = _index; alert('change'); }else{ alert('no change'); } }纯属手误,一个,号误打成;号了,话说你们都不会调试下么。。不能修改回复,这是什么狗屁设定。。 求助一个js上传文件的怎么写? 100分奉上!!!求高手做出这个JS效果 求editorgrid +c#保存数据的前后台代码? 高手帮忙,一个多个人员选择的解决方案 用javascript怎样实现图片模糊效果 编写inf的问题,如何将文件安装到指定的目录中去? 用open方法打开时有有问题? javascript求救 中秋节了 还得麻烦大家来讨论这个问题 document.getElementById 得到的事什么 请大家指点 CSDN的“显示导航”是怎么实现的 用js实现一个简单特效 求高手指点!我用for in 遍历 form数组对象的时候 出现了一个我目前无法理解的现象!!!!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<select id="select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<button id="button">button</button>
<script>
var selector = document.getElementById('select'),
index = selector.selectedIndex;
button = document.getElementById('button');
button.onclick = function(){
var _index = selector.selectedIndex;
if(_index !== index){
index = _index;
alert('change');
}else{
alert('no change');
}
}
</script>
</body>
</html>
index = selector.selectedIndex,
button = document.getElementById('button');
button.onclick = function(){
var _index = selector.selectedIndex;
if(_index !== index){
index = _index;
alert('change');
}else{
alert('no change');
}
}纯属手误,一个,号误打成;号了,话说你们都不会调试下么。。
index = selector.selectedIndex,
button = document.getElementById('button');
button.onclick = function(){
var _index = selector.selectedIndex;
if(_index !== index){
index = _index;
alert('change');
}else{
alert('no change');
}
}纯属手误,一个,号误打成;号了,话说你们都不会调试下么。。不能修改回复,这是什么狗屁设定。。