$('#area').change(function(){
if(this.options[0].value==-1){
this.options[0]=null;
$('#show').val() = this.value;
}
});
/* document.getElementById('area').onchange=function (){
if(this.options[0].value==-1)this.options[0]=null;
document.getElementById('show').value=this.value
};*/
注释的那个是网上找的 我想给他改成上面的样式 哪里改错了
$('#area').change(function(){
$('#show').val($(this).find("option:selected").text()) ;
});
$('#show').val() = this.val();
$('#area').change(function(){
if($(this).options[0].val()==-1){
$(this).options[0]=null;
$('#show').val() = this.val();
}
});
试试
$('#show').val() = this.value;
修改成 $('#show').val(this.value);
试试^^
this ?是$(this)好吗