This one liner jQuery snippet will force your browser to go to the top of your page:
$('html, body').animate({ scrollTop: 0 }, 0);
If you want to add some smooth scrolling:
$('html, body').animate({ scrollTop: 0 }, 'slow');
Here is the one where i used when he resets, i am making this
%input.btnCancel{:type => "reset", :value => "Reset without saving", :id => "reset"}
$('#reset').click(function() {
$('html, body').animate({ scrollTop: 0 }, 0);
location.reload().scrollTop(0);
});
$('html, body').animate({ scrollTop: 0 }, 0);
If you want to add some smooth scrolling:
$('html, body').animate({ scrollTop: 0 }, 'slow');
Here is the one where i used when he resets, i am making this
%input.btnCancel{:type => "reset", :value => "Reset without saving", :id => "reset"}
$('#reset').click(function() {
$('html, body').animate({ scrollTop: 0 }, 0);
location.reload().scrollTop(0);
});