Home >Web Front-end >HTML Tutorial >The difference between html empty link href='#' and href='javascript:void(0)'_HTML/Xhtml_Webpage Production

The difference between html empty link href='#' and href='javascript:void(0)'_HTML/Xhtml_Webpage Production

WBOY
WBOYOriginal
2016-05-16 16:41:541232browse

#Contains a location information
The default anchor is #top, which is the top of the web page
And javascript:void(0) only represents a dead link
This is why sometimes the page is very long and the browsing link is obvious Yes # but jumps to the top of the page
But javascript:void(0) is not the case
so it is best to use void(0) when calling the script
You can use the following example to test it:
Code



Tip: You can modify part of the code before running
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn