title: remove text from url string javascript
body: <p>I want to display, with javascript, just the filename of the page the user is on. For example,</p>
  
  <pre><code>https://test.example.com/wow.html
  </code></pre>
  
  <p>should return</p>
  
  <pre><code>wow
  </code></pre>
  
  <p>I was trying to use the <code>replace()</code> method, like so:</p>
  
  <pre><code>var url = document.URL;
  document.getElementById("code").innerHTML = url.replace("http://test.example.com/", " ");
  </code></pre>
  
  <p>But I can't figure out how to remove the .html extension as well, or also replace https urls. Is there a better way to do this?</p>
  
  <p>Thanks.</p>