title: Extracting numbers from a HTML string then append to URL
body: <p>Hi i am trying to get just the numbers from a html string and append them to a URL which is then wrote to the page as a example:</p>
  
  <pre><code>&lt;p id="catId"&gt;cat number 2301254187&lt;/p&gt;
  &lt;script type="text/javascript"&gt;
          var itemId = document.getElementById('catId').innerHTML;
          var links = '&lt;a href="http://www.test.com' + catId + '"&gt;Go to Catergory&lt;/a&gt;';
          document.write(links);
  </code></pre>
  
  <p></p>
  
  <p>Ive tried something like above which works but i get the whole of the contents of the p tag. Im pretty new to this and im guessing that regular expressions need to be used to extract the numbers only?</p>