bootstrap go to up button code example
Example 1: scroll to top
$("#scroll_icon").click(function()
{
jQuery('html,body').animate({scrollTop:0},2000);
})
Example 2: javascript go to top of page
window.scroll({top: 0, left: 0});
$('html,body').scrollTop(0);
$('html, body').animate({ scrollTop: 0 }, 'fast');
Example 3: simple button scrolling with this
$('#id a').on('click', function (e) {
var href = $(this).attr('href')
$('html, body').animate({
scrollTop: $(href).offset().top
}, '300')
e.preventDefault()
})