When using <a> tags, we often bind other events such as OnClick, when we assign a value of "#" to the href attribute of the <a> tag, "Javacript:;", "javacript:void (0);" such as
One, href= "Javacript:;" In this case the browser will appear to access "javascript:;" The phenomenon of this address, so in any case is not recommended to use;
Second, href= "javacript:void (0);" indicates that a JavaScript statement is executed after clicking on the link: void (0); This statement indicates that nothing is done and is an empty statement. When the onclick () event is bound and clicked, the page stays in place;
Third, href= "#" This is the use of HTML links, meaning to jump to the top of the page, if you want to quickly return to the top, then use this link, this use is called anchor.
Four, if you want to use a tag to call a function, there are two ways:
1) <a href= "javascript:void (0);" onclick= "Hello ();" > Point me </a>
2) <a href= "Javascript:hello (); > Point me </a>
Therefore, the appropriate usage should be chosen in different scenarios.
A tag in href= "Javacript:;" href= "javacript:void (0);" href= "#" Difference