title: Not able to animate scroll div to top of page on click
body: <p>I am working on this demo. Why am I not able to animate the <code>#box-2</code> div to top on click?</p>
  
  <pre><code>$('#box-2').animate({scrollTop : 0},700);
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("#box-2").on("click", function(){
    $('#box-2').animate({scrollTop : 0},700);
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body, html {
    width: 100%;
    height: 100%; }
  
  .box{
    height: 100vh;
  }
  #box-1{
   background:khaki;
  }
  #box-2{
   background:red;
  }
  #box-3{
   background:green;
  }
  #box-4{
   background:orange;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous"&gt;
  &lt;div class="col-md-12 box" id="box-1" &gt; &lt;/div&gt;
  &lt;div class="col-md-12 box" id="box-2" &gt; &lt;/div&gt;
  &lt;div class="col-md-12 box" id="box-3" &gt; &lt;/div&gt;
  &lt;div class="col-md-12 box" id="box-4" &gt; &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>