parseInt(document.getElementById("hp").innerHTML);
var x = /\d+/.exec("<span id=\"hp\">20%</span>"); alert(x);
<script> var x = '20%' alert(x.replace(/%/,'')) </script>
<script> var x = '20%' alert(x.replace(/\d+/,'')) </script>