Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
- <!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>
- <script language="javascript" type="text/javascript">
- function sum() {
- var x = document.getElementById('<%= txtA.ClientId %>');
- var a = x.value;
- var y = document.getElementById('<%= txtB.ClientId %>');
- var b = y.value;
- var c = a + b;
- alert(c);
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <asp:TextBox ID="txtA" runat="server" />
- <asp:TextBox ID="txtB" runat="server" />
- <span id="a" />
- <input type="button" onclick="javascript: return sum();" />
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment