有一个开始连接和停止连接开始 停止现在的问题是我点开始后,我要不能再点效果  就变成灰色
除非点停止后再能点开始 否则只能点一次开始!谢谢

解决方案 »

  1.   


    <input type="button" id="ostart" value=" Start " onclick="this.disabled='disabled'" />
    <input type="button" value=" Stop " onclick="document.getElementById('ostart').disabled = false;" />
      

  2.   

    <a href="#" id="start" onclick="this.disabled=true;document.getElementById('end').disabled=false;">开始</a>
    <a href="#" id="end" disabled onclick="this.disabled=true;document.getElementById('start').disabled=false;">结束</a>
      

  3.   

    感谢两位的回答我本身有两个方法
    <a href="#"  onClick="update();" >开始</a>
    <a href="#"  onClick="Stopupdate();"  >停止</a>我怎么样加才行啊
      

  4.   


    <script type="text/javascript">
    <!--
    function update(ostart){
    ostart.disabled = 'disabled';
    } function Stopupdate(){
    document.getElementById("ostart").disabled = false;
    }
    //-->
    </script>
    <a href="#" id='ostart'  onClick="update(this);" >开始 </a> 
    <a href="#"  onClick="Stopupdate();"  >停止 </a> 
      

  5.   

    <a href="#" id="start" onclick="update();this.disabled=true;document.getElementById('end').disabled=false;">开始</a>
    <a href="#" id="end" disabled onclick="Stopupdate();this.disabled=true;document.getElementById('start').disabled=false;">结束</a>
      

  6.   

    不知道为什么我一点开始还是运行update();方法了明明看书灰色
    为什么还是起作用呢那出问题了
      

  7.   

    这是我的两个方法//开始自动刷新
    function update(){
    timeout = window.setInterval("sendRequest()", 1000);//设定1秒调用一次update.asp页面
    }
    //停止自动刷新
    function Stopupdate(){
    if (timeout != null){
    window.clearInterval(timeout);
    }
    }
    我是想只能点一下update()起作用现在是点一下 本来是1秒变0.5  点Stopupdate()还不能停点一次开始就点一下Stopupdate()就可以停点两次以上update()就停不了
    并且还是越来越快我意思是能不能控制点update()一直是1秒不要累加  点Stopupdate()应该可以停或只能点一下update() 点Stopupdate()后才能再点update() 可以在原来代码上加代码解决
      

  8.   

     s_liangchao1s 写的可行2楼的代码可以解决!
    谢谢!
    连接不能解决就只能用按钮了