title: Make the user's viewport scroll up upon clicking a certain css class or ID
body: <p>(for reference I am using DIVI for Wordpress, trying to accomplish this with a code block)</p>
  <p>I have a slider/carousel with 7 steps that all have &quot;next&quot; and &quot;previous&quot; buttons for the user to go through. When a user clicks next onto step 2, because the step 1 window is larger than step 2, it means their window is now below step 2 (the &quot;next&quot; and &quot;previous&quot; buttons are at the bottom of each slider).</p>
  <p>The buttons currently use a # link to open the next slider which works well, but I need a function that makes it so when one of the links (all have the class &quot;.rv-welcome-stagebutton&quot;) is clicked, it moves the window back up to the top of the carousel.</p>
  <p>So the user doesn't have to constantly scroll back to the top of each stage.</p>
  <p>I have tried using the current code on the page but no luck.</p>
  <p>TLDR: what I'm trying to achieve -</p>
  <ul>
  <li>User clicks a link with css class &quot;.rv-welcome-stagebutton&quot;</li>
  <li>scroll the window up to the top of the section with ID &quot;#rv-welcomeslider-container&quot;</li>
  </ul>
  <p>[GIF OF PAGE IN ACTION: <a href="https://i.imgur.com/fQiFjnK.gif" rel="nofollow noreferrer">https://i.imgur.com/fQiFjnK.gif]
  </a></p>
  <pre><code>    &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js&quot;&gt;                              
  jQuery(document).ready(function(){
    $('.rv-welcome-stagebutton').click(function(){
    window.scroll({
    top: 0, 
    left: 0, 
    behavior: 'smooth'
  });}   }                   
  
  &lt;/script&gt;
  </code></pre>