Вычисления в JavaScript
Привет,
Мне нужен расчет в javascript.
Ниже приведен мой код в .net
Что я уже пробовал:
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .style1 { width: 100%; } .style2 { width: 128px; } </style> </head> <body> <form id="form1" runat="server"> <div> <table class="style1"> <tr> <td class="style2"> <asp:Label ID="Label1" runat="server" Text="Total Amount"></asp:Label> </td> <td> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="style2"> <asp:Label ID="Label2" runat="server" Text="Discount Percent"></asp:Label> </td> <td> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="style2"> <asp:Label ID="Label3" runat="server" Text="Toatl % Amount"></asp:Label> </td> <td> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> </td> </tr> <tr> <td class="style2"> </td> <td> <asp:Button ID="Button1" runat="server" Text="Calculate" /> </td> </tr> <tr> <td class="style2"> </td> <td> </td> </tr> </table> </div> </form> </body> </html>
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click TextBox3.Text = TextBox1.Text * TextBox2.Text / 100 End Sub
i want above code behind code in javascript. Thanks Basit.