<div id="div"></div>
<select onchange="div.innerHTML=this.options[this.selectedIndex].unit">
<option unit="万">买房</option>
<option unit="元">出租</option>
</select>

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
      function changeUnit(){
        var selectIndex = document.all("select1").selectedIndex;
    if(document.all("select1").options[selectIndex].value=="1"){
      document.all("unit").innerText="万元";
    }else{
      document.all("unit").innerText="元";
    }
      }
    //-->
    </SCRIPT>
    <BODY>
    <TABLE border="1">
    <TR>
    <TD nowrap>
      <select name="select1" onchange="changeUnit()">
        <option value="1">买房</option>
    <option value="2">出租</option>
      </select>   <div id="unit">万元
      </div>
    </TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>
      

  2.   

    function fun(){
           var a=document.getElementsByName("select1")[0].value;       if(a=="1"){           document.getElementById("div1").style.display="";
               document.getElementById("div2").style.display="none";
               
           }else{           document.getElementById("div1").style.display="none";
               document.getElementById("div2").style.display="";
           }
        }
    <select name="select1" onchange="fun()">
        <option value="1">房</option>
        <option value="2">出租</option>
    </select >
    <div id="div1">万元</div>
    <div id="div2"> 元/月</div>