62,072
社区成员
发帖
与我相关
我的任务
分享
window.onload=function()
{
var lbl = document.getElementById( "label1 ");
if(lbl.outerText == " ")
{
lbl.style.display = "none; ";
return;
}
}
window.onload=function()
{
var lbl = document.getElementById("label1");
if(lbl.value == "")
{
lbl.style.display ="none;";
return;
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test3.aspx.cs" Inherits="test3" %>
<!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 runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellspacing="0" class="style1">
<tr>
<td>
<asp:Label ID="Label1" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>