demo:<script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> window.onload=function(){ var s1=document.getElementById("s1"); var s2=document.getElementById("s2"); var s3=document.getElementById("s3");
s1.onchange=function(){resetOption(s1,s2,s3);}; s2.onchange=function(){resetOption(s2,s1,s3);}; s3.onchange=function(){resetOption(s3,s1,s2);}; s1.onclick=function(){bo=this.options[this.selectedIndex];}; s2.onclick=function(){bo=this.options[this.selectedIndex];}; s3.onclick=function(){ bo=this.options[this.selectedIndex]; }; function resetOption(p1,p2,p3){ var opt=p1.options[p1.options.selectedIndex]; for(var i=0;i<p2.options.length;i++){ if(p2.options[i].value==opt.value)p2.options[i]=null; } for(var i=0;i<p3.options.length;i++){ if(p3.options[i].value==opt.value)p3.options[i]=null; }
参考一下
<script type="text/javascript">
window.onload=function(){
var s1=document.getElementById("s1");
var s2=document.getElementById("s2");
var s3=document.getElementById("s3");
s1.onchange=function(){resetOption(s1,s2,s3);};
s2.onchange=function(){resetOption(s2,s1,s3);};
s3.onchange=function(){resetOption(s3,s1,s2);};
s1.onclick=function(){bo=this.options[this.selectedIndex];};
s2.onclick=function(){bo=this.options[this.selectedIndex];};
s3.onclick=function(){
bo=this.options[this.selectedIndex];
};
function resetOption(p1,p2,p3){
var opt=p1.options[p1.options.selectedIndex];
for(var i=0;i<p2.options.length;i++){
if(p2.options[i].value==opt.value)p2.options[i]=null;
}
for(var i=0;i<p3.options.length;i++){
if(p3.options[i].value==opt.value)p3.options[i]=null;
}
sortOption(p2);
sortOption(p3);
}
function sortOption(p){
var index=p.options.length;
var flg=true;
for(var i=p.options.length-1;i>=0;i--){
if(p.options[i].value>bo.value)index=i;
if(p.options[i].value==bo.value)flg=false;
}
if(flg){
p.options[p.options.length]=new Option(bo.text,bo.value);
p.insertBefore(p.options[p.options.length-1],p.options[index]);
}
}
};
</script>
<select id="s1">
<option value=0>0</option>
<option value=3>3</option>
<option value=4>4</option>
</select>
<select id="s2">
<option value=1>1</option>
<option value=3>3</option>
<option value=4>4</option>
</select>
<select id="s3">
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
</select>