单击按钮时转到网页上的特定位置

tom*_*800 1 html javascript

你好,我是 javascript 和 html 的初学者,我想知道按下按钮时是否可以转到网页上的特定位置(无需重新加载页面),但我不知道该怎么做。

谢谢。

小智 7

我唯一想到的是像这样的链接;

<a href="#yourContentIdHere">name you want to appear as the link here</a>


<div id="yourContentIdHere">
your awesome content
</div>
Run Code Online (Sandbox Code Playgroud)