<p>What is the JavaScript to scroll to the top when a button/link/etc. is clicked?</p>

[{'answer_id': 48925, 'author': 'John Boker', 'author_id': 2847, 'author_profile': 'https://Stackoverflow.com/users/2847', 'pm_score': 4, 'selected': True, 'text': '<pre><code>&lt;a href="javascript:scroll(0, 0)"&gt;Top&lt;/a&gt;\n</code></pre>\n'}, {'answer_id': 48939, 'author': 'Rob Rolnick', 'author_id': 4798, 'author_profile': 'https://Stackoverflow.com/users/4798', 'pm_score': 2, 'selected': False, 'text': '<p>If you had an anchor link at the top of the page, you could do it with anchors too.</p>\n\n<pre><code>&lt;a name="top"&gt;&lt;/a&gt;\n&lt;a href=\'#top"&gt;top&lt;/a&gt;\n</code></pre>\n\n<p>It\'ll work in browser\'s with Javascript disabled, but changes the url. :( It also lets you jump to anywhere the name anchor is set.</p>\n'}, {'answer_id': 68626, 'author': 'scunliffe', 'author_id': 6144, 'author_profile': 'https://Stackoverflow.com/users/6144', 'pm_score': 0, 'selected': False, 'text': '<p>actually, this works by itself, no need to define it.</p>\n\n<pre><code>&lt;a href="#top"&gt;top&lt;/a&gt;\n</code></pre>\n\n<p>This is a "magic" hashname value that does not need to be defined in browsers.</p>\n\n<p>Just like this will "reload" the page.</p>\n\n<pre><code>&lt;a href="/"&gt;reload&lt;/a&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/48919', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2469/']