<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script type="text/javascript">
var stat = true;
$("div").ready(function(){
$(this).click(function(){
if(stat){
$("input#specInput").attr('disabled',true).val('点一下就可以用了');
stat = false;
return false;
}else{
$("input#specInput").attr('disabled',false).val('灰色就不可用啦');
stat = true;
return false;
}
});
});
</script><div>
<input id="specInput" type="button" value="灰色就不可用啦">
</div>

解决方案 »

  1.   

    <html>
        <head>
        </head>
        <body>
        <script language="javascript">
        function choose(aa)
        {
            aa.disabled = true;
            if(aa.id == "ymctrlid") document.all.bkctrlid.disabled = false;
            else document.all.ymctrlid.disabled = false;
        
        }
        </script>
                <input type="button" id="ymctrlid"  value="页面控制" name="ymctrl" onclick="choose(this)">
            <input type="button" id="bkctrlid" disabled="true" value="板块控制"  onclick="choose(this)">
        </body>
    </html>
      

  2.   

    应该这样,disabled的值为false时,可用,值为true时,不可用<html>
        <head>
        </head>
        <body>
        <script language="javascript">
        function choose(aa)
        {
           if(aa.name=="ymctrl")
            {
                aa.disabled= true;
                document.getElementById("bkctrlid").disabled=false;
            }    
        }
        </script>
                <input type="button" id="ymctrlid"  value="页面控制" name="ymctrl" onclick="choose(this)">
            <input type="button" id="bkctrlid" disabled="false"  value="板块控制" name="bkctrl" > 
        </body>
    </html>
      

  3.   


    <html>
        <head>
        </head>
        <body>
        <script language="javascript">
        function choose(aa)
        {
            if(aa.name=="ymctrl")
            {
                aa.disabled=true;
                document.all.bkctrlid.disabled=false;
            }
        
        }
        </script>
                <input type="button" id="ymctrlid"  value="页面控制" name="ymctrl" onclick="choose(this)">
            <input type="button" id="bkctrlid" disabled="false" value="板块控制" name="bkctrl">
        </body>
    </html>