function MM_changeProp(objId,x,theProp,theValue) { //v9.0
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}
//-->
</script>
</head>
<body>
<p align="center"><b><font size="5" color="#0000FF">ERIDEON GROUP</font></b></p>
<p align="center"><font color="#FF00FF" size="6">Programming Logic Questions</font></p>
<p align="center" class="STYLE2"><font face="Arial Black" color="#008080">Finished by Sun Fan</font></p>
<p align="center"><font size="5" color="#008080">1.Html,Css,JavaScript</font></p>
<p align="center">
  <select name="regprovince" class="style1" id="D1" onchange="MM_popupMsg(''+(this.options[this.selectedIndex].value)+'');MM_changeProp('D1','','fontWeight','Bolder','SELECT')">
    <option value="Item 1">Item 1</option>
    <option value="Item 2">Item 2</option>
    <option value="Item 3">Item 3</option>
    <option value="Item 4">Item 4</option>
    <option value="Item 5">Item 5</option>
      </select>
</p>
我想实现两个功能,1,点下拉菜单的时候弹出选中的值,1,点的时候被选的字体变粗,其他的不变 
我使用的DW,目前是一点中,所有的全部变成粗体,而不是我想要的效果

解决方案 »

  1.   

    怎么还是你:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    <script>
    function MM_changeProp(objId,x,theProp,theValue) { //v9.0
      var obj=event.srcElement;
      obj=obj.options[obj.selectedIndex];
      eval("obj.style."+theProp+"="+theValue);  
    } </script> 
    </head> <body><body> 
    <p align="center"> <b> <font size="5" color="#0000FF">ERIDEON GROUP </font> </b> </p> 
    <p align="center"> <font color="#FF00FF" size="6">Programming Logic Questions </font> </p> 
    <p align="center" class="STYLE2"> <font face="Arial Black" color="#008080">Finished by Sun Fan </font> </p> 
    <p align="center"> <font size="5" color="#008080">1.Html,Css,JavaScript </font> </p> 
    <p align="center"> 
      <select name="regprovince" class="style1" id="D1" onchange="MM_changeProp('D1','','color','red','SELECT')"> 
        <option value="Item 1">Item 1 </option> 
        <option value="Item 2">Item 2 </option> 
        <option value="Item 3">Item 3 </option> 
        <option value="Item 4">Item 4 </option> 
        <option value="Item 5">Item 5 </option> 
          </select> 
    </p> 
    </body>
    </html>