Scroll to relevant element with pure JavaScript.