Program to add two numbers using HTML 5 and JavaScript.

Program to add two numbers using HTML 5 and JavaScript.


<!DOCTYPE html>
<html>
<head>
<title></title>
<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;
}</script>
</head>
<body>
<input id="first">
<input id="second">
<button onclick="add()">Add</button>
<input id="answer">
</body>
</html>



its work fine
Try it  

Comments

Popular posts from this blog

A Javascript Program To make (open new window and close that window) button in your web browser.