title: Evaluate a string of a mathematical expression in javascript
body: <p>I am having problems getting my equals function to work correctly is JS, it is just printing the string and now computing the equation, The input save to history feature is working but the completion of the equation is not.</p>
  
  <p>JAVASCRIPT</p>
  
  <pre><code>  function displynum(n1){
    calcform.txt1.value=calcform.txt1.value+n1;
    }
    $(document).ready(function(){
      $('.numberfunc').click(function(){
        displynum($(this).val());
      });
      $("#eqlbtn").click(function(){
        z1 = $("#txt1").val();
        $("#history").append(z1 + "&lt;br&gt;");
      });
    });
  </code></pre>
  
  <p><a href="https://pastebin.com/MQj9VnaC" rel="nofollow noreferrer">https://pastebin.com/MQj9VnaC</a></p>
  
  <p>All my code is in the pastebin</p>