price.innerHTML = Number(location.hash.substring(1) || location.pathname.split('/').pop()) || price.innerHTML;
<head> </head> <body> <div id='price'></div> <script> <script>price.innerHTML = Number(location.hash.substring(1) || location.pathname.split('/').pop()) || price.innerHTML;</script> </script> </body>