页面置顶置底按钮的简单添加

在页面的顶部加入代码:

<a name="startPotion" ></a>

然后置顶按钮:

<input type="button" value="置顶" onclick="toTop()">

js函数:function toTop(){

    Window.location.href = "#startPotion"

}

 

置底的方法同置顶

原文地址:https://www.cnblogs.com/loveLearning/p/2543579.html