通过下拉框的选择 让原来暗着的按钮再变亮恢复功能
按钮是在点击以后变暗的   然后上边有个下拉框 我要把下拉框内容换了以后让按钮再变亮  该怎么弄?

解决方案 »

  1.   

    <html> 
    <HTML> 
    <HEAD> 
    <TITLE>   New   Document   </TITLE> 
    <script   type="text/javascript"> 
    function Op(v)
    {
      b1=document.getElementById('b1');
      b1.disabled=v=="true"?true:false;
    }
    </script> 
    </HEAD> <BODY> 
    <select onchange="Op(this.value)">
    <option value='true'>true</option>
    <option value='false'>false</option>
    </select>
    <br/>
    <button id='b1' disabled="true" onclick="alert('GG/GL')">Button1</button>
    </BODY> 
    </HTML> 
      

  2.   

    <html> 
    <HTML> 
    <HEAD> 
    <TITLE>   New   Document   </TITLE> 
    <script   type="text/javascript"> 
    function Op(v)
    {
      var b1=document.getElementById('b1');
      b1.disabled=v=="true"?true:false;
    }
    </script> 
    </HEAD> <BODY> 
    <select onchange="Op(this.value)">
    <option value='true'>true</option>
    <option value='false'>false</option>
    </select>
    <br/>
    <button id='b1' disabled="true" onclick="alert('GG/GL')">Button1</button>
    </BODY> 
    </HTML> 少了一个var
      

  3.   

    呵呵~~楼上整解忘记ie下变量名不能和控件id一样,除非使用var来声明变量