js 跳到页面最顶、最底的相关代码

<html>
<body>
<a href="javascript:void(0);" onclick="javascript:document.getElementsByTagName('BODY')[0].scrollTop
=document.getElementsByTagName('BODY')[0].scrollHeight;">到页底</a>
<div style="height:3000px;"></div>
<a href="javascript:void(0);" onclick="javascript:document.getElementsByTagName('BODY')[0].scrollTop=0;">回页顶</a>
</body>
</html>

相关推荐