<html>
<head>
<script>
function add(){
var f_no,s_no,c;
f_no=Number(document.getElementById("first").value);
s_no=Number(document.getElementById("second").value);
c=f_no+ s_no;
document.getElementById("answer").value= c;
}
</script>
</head>
<body>
Enter the First number : <input id="first">
Enter the Second number: <input id="second">
<button onclick="add()">Calculate</button>
<input id="answer">
</body>
</html>
<head>
<script>
function add(){
var f_no,s_no,c;
f_no=Number(document.getElementById("first").value);
s_no=Number(document.getElementById("second").value);
c=f_no+ s_no;
document.getElementById("answer").value= c;
}
</script>
</head>
<body>
Enter the First number : <input id="first">
Enter the Second number: <input id="second">
<button onclick="add()">Calculate</button>
<input id="answer">
</body>
</html>
No comments:
Post a Comment