title: Extract numeric value from element and divide it by some number
body: <p>It's my first time posting here, so be mindful with my lack of coding skills.</p>
  
  <p>So, I've been trying hard to make this code to work out and nothing worked so far. I want to extract the numeric value of an HTML and get this numeric value divided and parse the results inside a span tag.</p>
  
  <p>It's important to say that I can't change this HTML easily because it's an output from a WordPress plugin.</p>
  
  <p>So, this is what I've came with my javascript and HTML code:</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 parcelamentoFinal() {
    var precoFinal = document.getElementById("finalPrice").firstElementChild;
    var n = Number(precoFinal.replace(/[^0-9\.-]+/g, ""));
  
    if (isNumeric(n) == true) {
      var divide = Math.round(n / 4);
      document.getElementById("parcelamento").innerHTML = divide;
    } else {
      document.getElementById("parcelamento").innerHTML = 'Não existe valor final.';
    }
  }
  
  function isNumeric(n) {
    return !isNaN(parseFloat(n)) &amp;&amp; isFinite(n);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h3 id="finalPrice" style=""&gt;&lt;span&gt;R$200&lt;/span&gt;&lt;/h3&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And I want to output the result in this HTML:</p>
  
  <pre><code>&lt;p&gt;ou até 4x de &lt;span id="parcelamento"&gt;&lt;/span&gt;, sem juros!&lt;/p&gt;
  </code></pre>
  
  <p>Well, it's not working.</p>
  
  <p>Can you guys help me out, please?</p>
  
  <p>Thanks in advance.</p>