title: Javascript scroll to div id
body: <p>I've searched on google the solution to my problem, and I can't understand why the code I've written work for everyone, but not for me.</p>
  
  <p>I've written this:</p>
  
  <pre><code>&lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          function scrollTo() {
              $('html, body').animate({ scrollTop: $('#div_id').offset().top }, 'slow');
              return false;
          }
      &lt;/script&gt;
      &lt;style type="text/css"&gt;
          .uno {
              height: 1000px;
              background: #808080;
          }
          .due {
              margin-top: 300px;
              height: 500px;
              background: #ff00ff;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="uno" onclick="scrollTo()"&gt; 
          Clicca
      &lt;/div&gt;
      &lt;div class="due" id="div_id"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>