BCA

WEB PROGRAMMING LAB

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8 PROGRAM 9 PROGRAM 10 PROGRAM 11 PROGRAM 12 PROGRAM 13 PROGRAM 14 PROGRAM 15 . . .

7.Create a webpage with two textboxes and command buttons to perform arithmetic operations and display the result in appropriate dialog boxes using JavaScript.

OUTPUT:
Enter the First number : Enter the Second number:

 
 

<html>
<head>
<script>
function add(){
var a,b,c;
a=Number(document.getElementById("first").value);
b=Number(document.getElementById("second").value);
c= a + b;
document.getElementById("answer").value= c;

window.alert("RESULT="+c);
}
</script>
</head>
<body>
Enter the First number : <input id="first">
Enter the Second number: <input id="second"><br>
<button onclick="add()">Add</button><br>
<input id="answer">
</body>
</html>