$(document).ready(function(){
$("select[name='accDoor.passModeTimeSeg.id']").change(function(e){debugger;
var oldvalue=$(this).attr('old');
var currentvalue=$(this).val();
$('select[name="accDoor.passModeTimeSeg.id"] option[value='+oldvalue+']').show();
if(currentvalue!="")
{
$('select[name="accDoor.passModeTimeSeg.id"] option[value='+currentvalue+']').hide();
}
$(this).attr('old',currentvalue);
});
$("select[name='accDoor.passModeTimeSeg.id']").change(function(e){debugger;
var oldvalue=$(this).attr('old');
var currentvalue=$(this).val();
$('select[name="accDoor.passModeTimeSeg.id"] option[value='+oldvalue+']').show();
if(currentvalue!="")
{
$('select[name="accDoor.passModeTimeSeg.id"] option[value='+currentvalue+']').hide();
}
$(this).attr('old',currentvalue);
});
});
菜鸟潜心学习,备份自用!
以下附上原文章出处,http://bbs.csdn.net/topics/391049615