title: Get the href value and then find it as an id
body: <p>I'm trying to build this section based on anchor navigation. When I click on a link I get to the desired anchor and the clicked link gains a class with a specific style, so far it works well:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;body&gt;
  
    &lt;nav&gt;
      &lt;div class="anchor-link" &gt; &lt;a href="#anchor1" &gt; Anchor 1 &lt;/a&gt; &lt;/div&gt;
      &lt;div class="anchor-link"&gt; &lt;a href="#anchor2"&gt; Anchor 2 &lt;/a&gt; &lt;/div&gt;
      &lt;div class="anchor-link"&gt; &lt;a href="#anchor3"&gt; Anchor 3 &lt;/a&gt; &lt;/div&gt;
      &lt;div class="anchor-link"&gt; &lt;a href="#anchor4"&gt; Anchor 4 &lt;/a&gt; &lt;/div&gt;
      &lt;div class="anchor-link"&gt; &lt;a href="#anchor5"&gt; Anchor 5 &lt;/a&gt; &lt;/div&gt;
    &lt;/nav&gt;
  
    &lt;div class="main-wrap"&gt;
      &lt;div id="anchor1"&gt;&lt;/div&gt;
      &lt;div id="anchor2"&gt;&lt;/div&gt;
      &lt;div id="anchor3"&gt;&lt;/div&gt;
      &lt;div id="anchor4"&gt;&lt;/div&gt;
      &lt;div id="anchor5"&gt;&lt;/div&gt;
     &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$(document).ready(function(){
    $(".anchor-link").on("click", function(){
      $(this).addClass("active");
      $(this).siblings().removeClass("active");
  </code></pre>
  
  <p>Now I'd like to get the value inside the href but this does not work and it returns undefined:</p>
  
  <pre><code>      var href = $(this).attr('href');
        console.log(href);
     })
  </code></pre>
  
  <p>Assuming it worked, and the var href holds the value of the clicked link, for example "#anchor1", how would I have to proceed to then find in the "main-wrap", the div with the id of "#anchor1"?</p>
  
  <p>Would this work, and how would I have to fill that find query?</p>
  
  <pre><code>$(".main-wrap").find(...);
  </code></pre>