Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

JavaScript tutorial Simple Addition

JavaScript tutorial Simple Addition

In this tutorial we are going to learn JavaScript simple addition through input text box, complete code is given below and code is easy to understand , still if you find any kind of difficulty then please comment, I will try to clear you …

JavaScript Simple Addition CodeĀ  / Script:

<!DOCTYPE html>
<html lang="en">
<title>JavaScript Simple Addition</title>
<meta charset="utf-8"/>
JavaScript Simple Addition
Tutorial by Sanjay Sir ( Codentricks )

<input type="text" id="num1" />
<input type="text" id="num2" />
<input type="submit" onclick="sum()" value="Submit" />
<div id="result"></div>

function sum(){
var num1=parseFloat(document.getElementById("num1").value);
var num2=parseFloat(document.getElementById("num2").value);
var sum;


JavaScript Simple Addition Demo

0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Newest Most Voted
Inline Feedbacks
View all comments

Great thanks for sharing the content, digifutura is also a best web development company in Taiwan