addition of 2 num


<html>
<head>
<title>addition of two numbers</title>
<script type="text/javascript" >
function add()
{
var a=document.getElementById("tx1").value;
var b=document.getElementById("tx2").value;
var n1=parseInt(a);
var n2=parseInt(b);
var c=n1+n2;
document.getElementById("tx3").value=c;
}
</script>
</head>
<body>
<h1>addition of two numbers</h1>
<form action=""name="MyForm">
<p>Num1<input type="text"id="tx1"size="20"></p>
<p>Num2<input type="text"id="tx2"size="20"></p>
<p>result<input type="text"id="tx3"size="20"></p>
<p><input type="button"value="add"onClick="add()">
<input type="reset"value="clear">
</p>
</form>
</body>
</html>

2 comments:

Unknown said...
This comment has been removed by the author.
Unknown said...

Thanks for sharing such an interesting Html5 Programming Stuff here.........

My Favorite Books

  • C and Data Structures by Ashok N. kamthane
  • Web Technologies by A. A. Puntambekar
  • Learn HTML and CSS with W3Schools
  • Learn JavaScript and Ajax with W3Schools
  • HTML5 Black Book: Covers Css3, Javascript,XML, XHTML, Ajax, PHP And Jquery
  • HTML5 Application Development Fundamentals: MTA Exam 98-375
  • .NET 4.0 Programming 6-In-1, Black Book
  • SQL Server 2008 R2 Black Book
  • Asp.net 4.0 Projects Covers: net 3.5 And .net 4.0 Codes, Black Book
  • UNIX Shell Programming 1 Edition by Yashavant Kanetkar
  • UNIX and Shell Programming 1 Edition by Richard F. Gilberg, Behrouz A. Forouzan
  • Computer Networks by Andrew S. Tanenbaum
  • Multiple Choice questions in computer science by Timothy J Williams