Write The Program That Calculate The Sum And Product Of Two Numbers Using Java Script As A Web Page?
<script language="JAVASCRIPT">
var a = document.getElementById("firstNumber");
var b = document.getElementById("seconfNumber");
function calculate_sum()
{
document.getElementById("result").value = (a+b);
}
function calculate_product()
{
document.getElementById("result").value = (a*b);
}
</script>
<html>
Enter the first no: <input type="text" id = "firstNumber" size="2"/><br/>
Enter the second no: <input type="text" id = "secondNumber" size="2"/>
<input type="button" value="Calculate_Sum" onclick="calculate_sum()"/>
<input type="button" value="Calculate_product" onclick="calculate_product()"/>
Result:<span … Read more