title: How to create a button to go back to the top of the page?
body: <p>I created a button with a link to go back to the top of the page.</p>
  
  <p>Here is the JS code :</p>
  
  <pre><code>(function ($) {
  
  /*--Scroll Back to Top Button Show--*/
  
  $(window).scroll(function(){
      if ($(this).scrollTop() &gt; 100) {
          $('#back-to-top').fadeIn();
      } else {
          $('#back-to-top').fadeOut();
      }
  });
  
  //Click event scroll to top button jquery
  
  $('#back-to-top').click(function(){
      $('html, body').animate({scrollTop : 0},600);
      return false;
  });
  
  })(jQuery);
  </code></pre>
  
  <p>Here is the HTML code:</p>
  
  <pre><code>&lt;a id="back-to-top" href="#"&gt;
    &lt;i class="fas fa-chevron-circle-up fa-4x"&gt;&lt;/i&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>It works very well, but I want to create a button instead of a link.</p>
  
  <p>I tested the following HTML code but it does not work. There is the button but it does not go back up the page :</p>
  
  <pre><code>&lt;button type="button" id="back-to-top" href="#"&gt;
    &lt;i class="fas fa-chevron-circle-up fa-4x"&gt;&lt;/i&gt;
  &lt;/button&gt;
  </code></pre>
  
  <p>How to create a button to go back to the top of the page ?</p>