Scroll down to the bottom of the HTML code and add the following code just before the </body> tag:
<a href="#" id="scroll-to-top"><i class="fa fa-arrow-up"></i></a>
<style>
#scroll-to-top {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 9999;
display: none;
}
#scroll-to-top i {
font-size: 24px;
}
</style>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js”></script>
<script>
$(document).ready(function(){
$(window).scroll(function () {
if ($(this).scrollTop() > 50) {
$('#scroll-to-top').fadeIn();
} else {
$('#scroll-to-top').fadeOut();
}
});
$('#scroll-to-top').click(function () {
$("html, body").animate({
scrollTop: 0
}, 600);
return false;
});
});
</script>