title: Jquery Smooth Scroll To DIV - Using ID value from Link
body: <p>So i'm having some issues with my JQuery which is suppose to scroll to particular divs.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="searchbycharacter"&gt;
      &lt;a class="searchbychar" href="#" id="#0-9" onclick="return false"&gt;0-9 |&lt;/a&gt; 
      &lt;a class="searchbychar" href="#" id="#A" onclick="return false"&gt; A |&lt;/a&gt; 
      &lt;a class="searchbychar" href="#" id="#B" onclick="return false"&gt; B |&lt;/a&gt; 
      &lt;a class="searchbychar" href="#" id="#C" onclick="return false"&gt; C |&lt;/a&gt; 
      ... Untill Z
  &lt;/div&gt;
  
  &lt;div id="0-9"&gt;
      &lt;p&gt;some content&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;div id="A"&gt;
      &lt;p&gt;some content&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;div id="B"&gt;
      &lt;p&gt;some content&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;div id="C"&gt;
      &lt;p&gt;some content&lt;/p&gt;
  &lt;/div&gt;
  
  ... Untill Z
  </code></pre>
  
  <p><strong>JQuery</strong></p>
  
  <p>What i want the code to do is: On click event of an .searchbychar A TAG > Take the ID attributes value and scroll to that...</p>
  
  <pre><code>$( '.searchbychar' ).click(function() {
  
      $('html, body').animate({
          scrollTop: $('.searchbychar').attr('id').offset().top
      }, 2000);
  
  });
  </code></pre>