如何检测<select>选项有没有变化。 解决100分! <select name="typeId" style="width:80" onchange="alert(this.options[this.selectedIndex].text)"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 同意楼上的,一般采用url参数传递的方法去获得select的selectedIndex属性,保存在一个文本框中,那么下一次提交,你再次获取这个属性就可以和这个文本框里的value进行比较了。 <select name="typeId" style="width=80" onchange="javascript:foo(this)"><option value="1">政法</option><option value="2">经济建设</option><option value="3">科教文卫</option><option value="4" selected="selected">侨务</option><option value="5">其他</option></select><script language=javascript>var history_selected_value = typeId.options[typeId.selectedIndex].value;function foo(args){ if(typeId.options[typeId.selectedIndex].value!=history_selected_value) { alert("changed"); }}</script> js图片切换 监听鼠标的点击事件获取屏幕坐标不正确 JS如何知道关闭计算机 那位大哥给小弟提供一个向这样的框架,左边是动态树,并且可以左右隐藏 对event.returnValue有些困惑,求解答 对象为空或不存在 如何拖曳方式设置模块(网页)的位置、大小 求一个动态生成下拉框的例子 href怎么传递js中的变量 使用Three.js实例无法浏览谷歌浏览器已经设置内容显示 javascript中能用doevents()函数吗? 我用javascript动态添加了几行表格,然后,想根据,checkbox来删除改行,并使checkbox的名字后缀是该行的行号,出了点问题提示checkbox的
<option value="1">政法</option>
<option value="2">经济建设</option>
<option value="3">科教文卫</option>
<option value="4" selected="selected">侨务</option>
<option value="5">其他</option>
</select>
<script language=javascript>
var history_selected_value = typeId.options[typeId.selectedIndex].value;
function foo(args){
if(typeId.options[typeId.selectedIndex].value!=history_selected_value)
{
alert("changed");
}}
</script>