I need to extract user-input information from text boxes and pass the values to a JavaScript function for displaying the result using the "window.alert()" method.
As of now, I am working with ASP.NET. Below is what I have in terms of the ASP.NET frontend and the JavaScript code:
<asp:Button ID="btnCalculateSalary" runat="server" Text="Calculate Salary" OnClick="calcFunction()" />
<script>
function calcFunction(c1, c2) {
c1 = document.getElementById('txtAnnualHours').value;
c2 = document.getElementById('txtPayRate').value;
return window.alert("Your Annual Salary is: " + c1 * c2);
}