js,html-点击直接跳转到页面底/顶部

案例一: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>

案例二:html描点控制。无滑动效果

<body>
<a href="#DD" >bottom</a>//跳到id为DD的锚点
// 内容
<a id='DD' ></a>//空的锚点
</body>
原文地址:https://www.cnblogs.com/hwaggLee/p/6530432.html