How to scroll an HTML page to a given anchor

function scrollTo(hash) {
    location.hash = "#" + hash;
}

No jQuery required at all!

Leave a Comment