title: jQuery - Find href that contains a value and return the full value
body: <p>I'd like to search the body for an href that contains <code>/test/</code>. I then want to return the entire href value e.g. <code>/test/123/</code>.</p>
  
  <p>Below is what I've come up with so far. I know that it can find <code>/test/</code> but I'm struggling with returning the full href value. Any ideas?</p>
  
  <pre><code>function() {
      var htmlString = $('body').html().toString();
      var index = htmlString.indexOf("/test/");
      if (index != -1)
          return index.closest('div').find('a').attr('href');
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div&gt;
      &lt;a href="/test/123/"&gt;Test&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>