a href=#> After clicking on the link, the page will scroll up to the top of the page, # The default anchor point is #TOP
<a href=javascript:void(0) onClick=window.open()> After clicking on the link, the page does not move, only the link is opened
<a href=# onclick=javascript:return false;> The function is the same as above, and different browsers will have differences.
After clicking on the link, if you don't want the page to scroll to the top of the page, use href=javascript:void(0), do not use href=#, return false has a similar effect
Detailed explanation of the difference between href=# and href=javascript:void(0)#Contains a location information
The default anchor point is #top, which is the upper end of the web page
And javascript:void(0) only represents a dead link
This is why sometimes the page is long and the link is obviously # but it jumps to the top of the page
And javascript:void(0) is not the case
So it is best to use void(0) when calling scripts
Or <input onclick>
<div onclick> etc.
Several ways to open a link in a new window
1.window.open('url')
2. Use custom functions
Copy the code