Explanation of the differences between a href = # And a href = javascript: void (0)
A href = "#"> after clicking the link, the page will be rolled up to the TOP, # The default anchor is # TOP
after you click the link, the page does not move and
1. Location:
Is an image in a Windows window. Its main function is to direct the current webpage to anotherHref is a property of a Web page. It can be used to direct another web page and refresh the page.
2.
A href = "#"> after clicking the link,
Javascript: What does void (0) mean and the difference between href = # And href = javascriptvoid (0,
In Javascript, void is an operator that specifies to calculate an expression but does not return a value.
The format of the void operator is as
after you click the link, the page will be rolled up to the TOP, # The default anchor is # TOP
after you click the link, the page does not move and only opens the link.
different browsers have different functions.
After clicking the link, if you
Href = "javascript: void (0);" and,
There are two ways to set the label to null link. The first is href = "#", and the other is href = "javascript: void (0 );". Both methods set the label to null link, but the two methods are somewhat different.
# Contains a location information
The default anchor is # top, that is, the top of the web page.
Javascript: void (0) only indicates a dead link.
This is why sometimes a long page browsing link is clearly #
Beat to top
This is not the case
"#" Contains a location informationThe default anchor is # top, that is, the top of the web page.Javascript: void (0) only indicates a dead link.
This is why sometimes a long page browsing link is clearly # But the page jumps to the top, while
If you do not set the href property below IE6, you will not respond to hover. Double-clicking will select the label's parent container instead of the one-a label (this problem exists under IE).
The code is as follows
Copy Code
Original: href and onclick usages, distinctions, precedence levels in Html a tagsIf you do not set the href attribute under IE6, hover will not respond. When you double-click the label's parent container is selected instead of the one-a-label (the
A Class="Bt_3" Href="Javascript: void (0 )" ID="Btnsubmit1" Onclick="Submitpage ()">SubmitA>
submit
Submitpage () is a function defined by me. It is used to submit a form when you click . FT and IE6 cannot be submitted.
This is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.