当前位置:编程学习 > JS >>

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>
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,