js对象为空
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript">
function show() {
debugger;
if ($('lblX').value == "0") {
alert('X不能为0!')
return false;
}
debugger;
else if ($('lblY').value == "0") {
alert('Y不能为0!')
return false;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblX" runat="server" Width="200">0</asp:Label>
<asp:Label ID="lblY" runat="server" Width="200">0</asp:Label>
<asp:Button ID="btn" runat="server" Text="ok" OnClientClick="show();" />
</div>
</form>
</body>
</html>