JavaScript Solve Equations Like (3 + 7) + 2 * 8 / 2 That Are Entered in a textarea solving equations like terms calculator,solving equations like terms,solving

Just use eval to evaluate the equation.

answer.innerHTML = eval(finalAnswer);

I updated your jsFiddle


Have a look at this answer as well. The question was about parsing a formula but it's pretty much usable for anything really.

Answer:1

You are just extracting a String from the text area and pasting it into the answer div. Strings are not just evaluated by javascript! What you are actually doing is var solve = '(3 + 7) + 2 * 8 / 2';! You would need a parser to actually solve that problem, like in this SO post.

Answer:2

You need to do more than that to solve the equations entered in a text box. Your current script only displays the content of the text box as is. You should use MathJS. It should help.

MathJS Home

Answer:3

EDIT : THe problem is that the site is sooo bad, and he is still in document.readyState = "interactive" so I don't have resize events :'( I'm working on a website (that I didn't made). I'm trying to ...

EDIT : THe problem is that the site is sooo bad, and he is still in document.readyState = "interactive" so I don't have resize events :'( I'm working on a website (that I didn't made). I'm trying to ...

I've written this code to create simple CSS and Javascript dropdown menu. HTML: <li><a href="#" onmouseover="showRanksSubmenu()" onmouseout="hideRanksSubmenu()">XYZ</a> <ul ...

I've written this code to create simple CSS and Javascript dropdown menu. HTML: <li><a href="#" onmouseover="showRanksSubmenu()" onmouseout="hideRanksSubmenu()">XYZ</a> <ul ...

  1. pure drop down menu css
  2. pure css drop down menu on click
  3. pure css drop down menu responsive
  4. dropdown pure css
  5. pure css drop down menu with arrow
  6. pure css drop down menu codepen
  7. pure css drop down menu transition
  8. pure css navigation drop down
  9. pure css hamburger dropdown menu
  10. pure css onclick dropdown menu
  11. pure css mega dropdown menu
  12. simple pure css drop down menu
  13. simple pure css drop down menu responsive

I have been developing github unofficial card. So that, I designed a simple card for this and create little script for toggling language stats and general stats. After that I realised one problem ...

I have been developing github unofficial card. So that, I designed a simple card for this and create little script for toggling language stats and general stats. After that I realised one problem ...

Get previous location path on back button click event using by angular.js What I want? I want to go previous page when i click the back button in my current page. HTML <input type="button" ...

Get previous location path on back button click event using by angular.js What I want? I want to go previous page when i click the back button in my current page. HTML <input type="button" ...