当我的鼠标在 Label1 上时,我想将 Label2 显示在它附近。然后,当我的鼠标离开 Label1 时,我想隐藏 Label2。我尝试使用以下代码。我的javascript很差。
<script language="javascript" type="text/javascript">
function LabelHover()
{
document.getElementById('Label1').style.display = 'inherit';
}
function Labelleave()
{
document.getElementById("Label1").style.display='none';
}
</script>
</head>
<body>
<asp:Label ID="Label1" runat="server" Text="Hello" Height="120" Width= "120" ForeColor="Brown" style=" left:220px; border:groove; top:15px " >
</asp:Label>
<asp:Label ID="Label2" runat="server" Text="Disclaimer" Height="17" Width= "100" ForeColor="Brown" onmouseover="LabelHover()" onmouseout="Labelleave()" style=" left:220px; " >
</asp:Label>