I have the following jQuery code
$(document).ready(function () { $(\'.navtoTop\').click(function(){ $(\"html\").scrollTop( $(\"#topofthePage\").of
You already got an answer on this. But, since you also want a smooth scrolling, consider the following alternative:
$('.navtoTop').click(function(){ $('html, body').animate({ scrollTop: $('#topofthePage').offset().top }, 1000); });