Scroll to the Top of a Div in an HTML Document in Javascript.
You may sometime want your Brwoser to scroll to a part of the HTML Document.
Typically when you load some content uisng AJAX, you would want to srcroll to the element which was updated.
You can do this with the following javascript code.
document.scrollTo(0, document.getElementById('id-of-element').offsetTop);
Enjoy Coding.
PR: 0



























