我必须显示一个指示数据插入成功的标签。标签应在 5 秒后自动消失,我该如何实现?
<html>
<head id="Head1" runat="server">
<title>Test Visibility</title>
<script type="text/javascript">
$(document).ready(function () {
setTimeout(function () {
$('#<%= lblError.ClientID%>').hide();
}, 100); // <-- time in milliseconds
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblError" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>