这样试试
function $(id){
    return document.getElementById(id);
}
var slt=$("city");
slt.onchange = function(){
   if(this.value==''){
      $('othercity').style.display="";
   }
   else{
      $('othercity').style.display="";
      $('othercity').value="";
   }
}

解决方案 »

  1.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
     </HEAD>
    <script type="text/javascript">
    function $(id){
        return document.getElementById(id);
    }
    var change=function(){
    for(var i=0;i<$("city").options.length;i++){
    if($("city").value==""){
    $('othercity').style.display="block";
    }else {
    $('othercity').style.display="none";
    $('othercity').value=""; 
    }
    }
    }</script>
     <BODY>
      <dt>所在城市:</dt>
    <select name='city' onchange="change()" id='city'>
    <option value='Bath'>Bath</option>
    <option value='Cambridge'>Cambridge</option>
    <option value='Leeds'>Leeds</option>
    <option value="">其他</option>
    </select>
    <input id='othercity' type='text' style="display:none;"/>
     </BODY>
    </HTML>
      

  2.   

        var slt=getValue("city");
        if (slt.options[slt.selectedIndex].value == "") {
            getValue('othercity').style.display="block"; 
            getValue('othercity').value = "";
        } else {
            getValue('othercity').style.display="none";
        }