title: Eval function for jquery
body: <p>I built a calculator and I am wondering how to handle the <code>eval()</code> function in jQuery. Is there any way to do it? Below, I wrote a javascript function that calculates and shows the result of the calculations. I would like to convert it to jQuery. Thanks in advance.</p>
  
  <pre><code>function result(val) {
      document.getElementById("resultBox").value = val;
  }
  
  function calc() {
      try {
          result(eval(document.getElementById("resultBox").value))
      }
      catch (result) {
          result('Error')
      }
  }
  
  $(document).ready(function () {
              $('.buttons').click(function () {
                  $('#resultBox').val($('#resultBox').val() + $(this).val());
              });
          });
  </code></pre>