就是在一个页面上随便点个按钮,即让整个页面不可用,不可点击???

解决方案 »

  1.   

    没做过,听说可以做一个覆盖整个页面的div
      

  2.   

    <script>
    function readonlyAll()
    {
      var testStr = "" ;
      var tempElements = null;
      
      for(i=0; i<document.all.length; i++) 
      {    if(document.all(i).tagName=="INPUT")
        {
            tempElements = document.all(i);
            //将输入域变为只读
            if(tempElements.type=="text")
            {
               
             tempElements.readOnly=true;
            }
            if(tempElements.type=="radio")
            {
             tempElements.disabled=true;
            }
            
        }
        //将选择域变为只读
        if(document.all(i).tagName=="SELECT")
        {
         tempElements = document.all(i);
         tempElements.disabled = true;
        }
        //将选择域变为只读
        if(document.all(i).tagName=="TEXTAREA")
        {
         tempElements = document.all(i);
         tempElements.disabled = true;
        }
        
      }}
    </script>
    在按纽中调用这个JS方法readonlyAll().
      

  3.   

    这样可以么:点击完button4以后,让所有的button的onclick事件返回false<!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=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript">
    function noclick() {
    var inputButton = document.getElementsByTagName("input");
    var link = document.getElementsByTagName("a");
    for (i = 0; i < inputButton.length; i++) {
    inputButton[i].onclick = function() {
    return false;
    }
    }
    }
    </script>
    </head>
    <body>
    <input type="button" value="button1" onclick=javascript:alert("button1")>
    <input type="button" value="button2">
    <input type="button" value="button3">
    <input type="button" value="button4" onclick="noclick()">
    </body>
    </html>
      

  4.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <style>
    #alldiv{
    left:0px;
    top:0px;
     width:100%;
     height:100%;
     display:none;
     position:absolute;
     z-index:100;
     background-color:red;
     filter:Alpha(opacity=10);
    }
    </style>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function showme(value)
    {
    if(value == 0)
    document.getElementById("alldiv").style.display = "block";
    else if(value ==1 )
    document.getElementById("alldiv").style.display = "none";}//-->
    </SCRIPT>
    <BODY>
    <input type="button" value="页面不可用" onclick=" showme(0);">
    <div id="alldiv" >
    <center><input type="button" value="恢复原始页面" onclick=" showme(1);"></div></center>
    </div>
    </BODY>
    </HTML>
      

  5.   

    8楼正解,除了html里的一点小错误(多了个</div>):
    <div id="alldiv" ><center><input type="button" value="恢复原始页面" onclick=" showme(1);"></center></div>