How do you do addition in html?
Using a few HTML statements and a little JavaScript, you can build your own calculator that performs addition. This task is not as difficult as it seems because HTML creates calculator controls for you, and JavaScript handles all the calculations. All you have to do is lay out the controls on your Web page so that they create the user interface you desire. Show Calculator Controls
JavaScript Logic
Usage
Enhancements
can we add numbers just only using html May 18 '07 #1
No. HTML is not a programming language. Use javascript. May 18 '07 #2
No. HTML is not a programming language. Use javascript. thanks for the sugestion Jun 4 '07 #3
We cannot add two numbers using HTML.You can use javascript for that Expand|Select|Wrap|Line Numbers Jun 6 '07 #4
Warning: the html and code listed in the above post is out of date (deprecated) and should not be used, though it will work. For modern methods, ask on the javascript board. Jun 6 '07 #5
check this code out, its for a calculator Expand|Select|Wrap|Line Numbers
Oct 23 '11 #6 Sign in to post your reply or Sign up for a free account. How do you do addition and subtraction in HTML?For doing sums you can use various symbols: add (“ + ”), subtract (“ - ”), divide (“ / ”) and multiply (“ * ”).
Can you do calculations with HTML?HTML calculator is used for performing basic mathematical operations like Addition, subtraction, multiplication, and division.
How do you add two input values in HTML?So there are a couple of things here.. The end bracket to your function is a ) not a }.. id in if (id == add) is not defined. You'll need to add an argument to your function to pass in what type of button is being pressed.. the last line document. getElementById("answer"). value = result; The Id should be output1.. How do you add an addition in JavaScript?Add numbers in JavaScript by placing a plus sign between them. You can also use the following syntax to perform addition: var x+=y; The "+=" operator tells JavaScript to add the variable on the right side of the operator to the variable on the left.
|