title: How do get input 2^3 to Math.pow(2, 3)?
body: <p>I have this simple calculator script, but it doesn't allow power ^.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function getValues() {
      var input = document.getElementById('value').value;
  
      document.getElementById('result').innerHTML = eval(input);
  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;label for="value"&gt;Enter: &lt;/label&gt;&lt;input id="value"&gt;
  
    &lt;div id="result"&gt;Results&lt;/div&gt;
  
    &lt;button onclick="getValues()"&gt;Get Results&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I tried using <code>input = input.replace( '^', 'Math.pow(,)');
  </code></p>
  
  <p>But I do not know how to get the values before '^' and after into the brackets.</p>
  
  <p>Example: (1+2)^3^3 should give 7,625,597,484,987</p>