You can set anchor points in the html page, and the anchor point definition
Html code
<a name="firstAnchor">&nsbp;</a>
Anchor point usage
Html code
<a href="#firstAnchor">跳至第一个锚点</a>
But for js, how to jump to a fixed anchor point on the page after completing an operation in js
location.href in js You can jump to a certain url;
How to jump to (locate to) a fixed anchor point
1. location.href = "#firstAnchor"; // firstAnchor is the anchor point Name
2, window.location.hash = "#firstAnchor"; // firstAnchor is the anchor name
After testing: the hash will only be used after the first jump to this page. Function, refreshing this page again will not work, and href will always work
The above js method to locate an anchor point is all the content shared by the editor. I hope it can give you a For reference, I also hope that everyone will support the PHP Chinese website.
For more js related articles on how to locate an anchor point, please pay attention to the PHP Chinese website!