title: Get the top host name of href on click
body: <p>I have a link where I want to get the top level domain name of the domain clicked. 
  In my example I have</p>
  
  <pre><code>    &lt;a href="http://www.example.com/this/that"&gt;click on this link&lt;/a&gt;
  </code></pre>
  
  <p>When I click on it I want an alert saying </p>
  
  <p>www.example.com</p>
  
  <p>I know window.location.host does this for the actual location of the site but am not sure how to get this for the individual href
  I have tried the below but it returns </p>
  
  <pre><code>    jQuery(document).on("click", "a", function (event) {
          event.preventDefault();
          var id = jQuery(this).attr('href') || 'nohref';
          alert(window.location.host);
          alert(id);
      });
  </code></pre>
  
  <p><a href="http://www.example.com/this/that" rel="nofollow">http://www.example.com/this/that</a></p>
  
  <p>rather than
  www.example.com</p>
  
  <p>What is the best way to achieve this?</p>