<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:
//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>无标题页</title>
     <script language="javascript" type="text/javascript">
        function close(){
           document.getElementById('close').style.display="none";
           document.getElementById('remove').style.display="none";
           alert("有没有反映呢");
        }
      function open()
      {
       alert("什么情况"):
          document.getElementById('close').style.display="block";
           document.getElementById('remove').style.display="block";
          
      }
    </script>
</head>
<body onload="open()" >
    <form id="form1" runat="server">
    <div style="background-color:Gray; top:132px">
    <div id="remove" style=" border:4px">
    <div id="close" onclick="close()" style=" width:26px; height:18px;
 background-color:Red"></div>
        <div> <label id="labTitle" runat ="server"  title="我是标题">
</label>&nbsp;
        </div>
       <div>
        <label id="labContent" runat="server" >rewrreeeeeeeeeeeeee
        eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeee</label></div>
    </div>
    </div>
    </form>
</body >
</html>

解决方案 »

  1.   

    代码复制下来 首先发现 你onload里面的那个方法的括号是错的....
      

  2.   


    <%@ Page Language="C#" AutoEventWireup="true" Codebehind="WebForm1.aspx.cs" Inherits="WorldCup.WorldCup.WebForm1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>无标题页</title>    <script language="javascript" type="text/javascript">
      function closeDiv(){
      document.getElementById('close').style.display="none";
      document.getElementById('remove').style.display="none";
      alert("有没有反映呢");
      }
      function open()
      {
      alert("什么情况");
      document.getElementById('close').style.display="block";
      document.getElementById('remove').style.display="block";
        
      }
        </script></head>
    <body onload="open()">
        <form id="form1" runat="server">
            <div style="background-color: Gray; top: 132px">
                <div id="remove" style="border: 4px">
                    <div id="close" onclick="closeDiv()" style="width: 26px; height: 18px; background-color: Red">
                        关闭
                    </div>
                    <div>
                        <label id="labTitle" runat="server" title="我是标题">
                        </label>
                        &nbsp;
                    </div>
                    <div>
                        <label id="labContent" runat="server">
                            rewrreeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
                            eeeeeeeeeeeeeeeeee</label></div>
                </div>
            </div>
        </form>
    </body>
    </html>自己做一下对比吧~ .  页面加载的时候出现问题. 第一个就是我刚才说的 open()方法   括号你用的全角.  第二点  open方面里面的alert() 后面的符号你写错了   是;不是:第三点就是方法名字的问题.
      

  3.   

    你用我发的代码试试看 ie  FF  chrome 下测试是没问题的了
      

  4.   

    你这代码是破洞百出,1.onload="open()">这个2.alert("什么情况"):
    我刚才试过了,你把方法名改了就可以了
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:
    //www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
       <title>无标题页</title>
       <script language="javascript" type="text/javascript">
       function closed(){
      
       alert("有没有反映呢");
       }
       function open()
       {
       alert("什么情况");
      
         
      }
       </script>
    </head>
    <body >
       <form id="form1" runat="server">
       <div style="background-color:Gray; top:132px">
       <div id="remove" style=" border:4px">
       <div id="close" onclick="closed()" style=" width:26px; height:18px;
      background-color:Red">close</div>
       <div> <label id="labTitle" runat ="server" title="我是标题">
    </label>&nbsp;
       </div>
       <div>
       <label id="labContent" runat="server" >rewrreeeeeeeeeeeeee
       eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
    eeeeeeeeeeeeeeeeee</label></div>
       </div>
       </div>
       </form>
    </body >
    </html>