HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p>We added the onclick event handler to the script and made sure that the page scrolls back to the beginning when the arrow button is clicked. The button itself does not disappear, although when the user is at the very top of the page, there is no longer any need to show it.</p>
1 <p>We added the onclick event handler to the script and made sure that the page scrolls back to the beginning when the arrow button is clicked. The button itself does not disappear, although when the user is at the very top of the page, there is no longer any need to show it.</p>
2 <p>In order to hide the button, we need to <a>remove the class</a>shown from it. This needs to be done if the vertical scroll value is not more than 200px. We already have a conditional construct that checks the scroll value and adds a class to the button if it scrolls more than 200px. Add the<a>alternative branch</a>else to the conditional statement: if the statement is false, then use the classList.remove method to remove the shown class from the button.</p>
2 <p>In order to hide the button, we need to <a>remove the class</a>shown from it. This needs to be done if the vertical scroll value is not more than 200px. We already have a conditional construct that checks the scroll value and adds a class to the button if it scrolls more than 200px. Add the<a>alternative branch</a>else to the conditional statement: if the statement is false, then use the classList.remove method to remove the shown class from the button.</p>
3 <p>After that, make sure that the page scrolls back to the top when you click the “Up” button and that the button itself is hidden.</p>
3 <p>After that, make sure that the page scrolls back to the top when you click the “Up” button and that the button itself is hidden.</p>