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 id="catId">cat number 2301254187</p>
<script type="text/javascript">
var itemId = document.getElementById('catId').innerHTML;
var links = '<a href="http://www.test.com' + catId + '">Go to Catergory</a>';
document.write(links);
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?