<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JS</title>
</head>
<body>
<div class="" style="height: 2000px;">top top top top top top top top</div>
<div style="background-color:#ccc ; font-size: 2em;"><a href="javascript:scroll(0,0);">top</a></div>
<div style=" font-size: 2em;"><a onclick="window.scrollTo(0,0);">top</a></div>
</body>
</html>