title: jQuery click link find div with matching id scrollTo
body: <p>I am creating a page. I have the following HTML:</p>
  
  <pre><code>        &lt;ul id="nav"&gt;
              &lt;li&gt;&lt;a href="#section1"&gt;Link&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#section2"&gt;Link&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#section3"&gt;Link&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#section4"&gt;Link&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#section5"&gt;Link&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#section6"&gt;Link&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
  
          &lt;div class="section"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section" id="section1"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section" id="section2"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section" id="section3"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section" id="section4"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section" id="section5"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="section" id="section6"&gt;
              &lt;p&gt;Content&lt;/p&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>What I would like to achieve is when a link is clicked. Use jQuery to find a div with the same id as the links href and then scroll the page to that div. Can anyone point me in the right direction? The bit I am struggling with is how to match the id to the href.</p>
  
  <p>Many thanks.</p>