Here value
gives you a string, hence the concatenation. Try parsing it as an Number instead:
var sum = parseInt(numberOne) + parseInt(numberTwo);
See the demo fiddle.
More Related Contents:
- javascript change element from another page
- How to create these webpages
- Load php function onClick [closed]
- How to pass parameters using ui-sref in ui-router to controller
- Adding options to select with javascript
- (HTML) Download a PDF file instead of opening them in browser when clicked
- How to append text to a “?
- Prevent zoom cross-browser
- Attach a body onload event with JS
- javascript onclick event over flash object
- Check a radio button with javascript
- Disable dragging an image from an HTML page
- Syntax highlighting code with Javascript [closed]
- When using jQuery on(), why use (document) vs. the element itself?
- javascript change background color on click [closed]
- Count textarea characters
- How can I change the font (family) for the labels in Chart.JS?
- Support for the experimental syntax ‘jsx’ isn’t currently enabled
- Encoding UTF-8 when exporting HTML table to Excel
- Unusual shape of a textarea?
- history.replaceState() example?
- Remove x-axis label/text in chart.js
- HTML canvas – drawing disappear on resizing
- How to display Image dynamically on UI?
- dotted stroke in
- How to do something before on submit?
- How to trigger change when using the back button with history.pushstate and popstate?
- Refresh iFrame (Cache Issue)
- Add Whatsapp function to website, like sms, tel
- How can I force input to uppercase in an ASP.NET textbox?