Good text to push: A tag of the href= "javascript:void (0)" and href= "#" Difference
Zhang Xin Xu This article is also very interesting, as a slight code neat programmer, the tangled when tangled: is the habit or norms!? Question: Why use href= "javascript:void (0);"?
A tag to write href attribute! ~ with href attribute, natural mouse hand type, as well as can be keyboard focus
and focus
time to enter analog click behavior (Support carriage return click and default can get focus).
The difference between href= "#" and href= "javascript:void (0)"
# contains a location information, the default anchor is #top that is the top of the page.
and javascript:void (0), only represents a dead link.
When the page is long, it uses # to locate the page in the format:# + ID.
If you want to define a dead link please use Javascript:void (0).
<a href= "javascript:void (0);" > I'm not responding to!</a>
<a href= "#pos" > point I position to the specified position!</a>
<br>
...
<br>
<p id= "POS" > trailing anchor points </p>
The key in Javascript:void (0) is the Void keyword, which is a very important keyword in JavaScript, which specifies that an expression is evaluated but does not return a value.
<body>
<script type= "Text/javascript" >
function GetValue () {
var a,b,c;
A = void (b = 5, c = 7);
document.write (' a = ' + A + ' B = ' + b + ' C = ' + C);
}
</script>
<p> Click the button below to view the results:</p>
<form>
<input type= "button" value= "Point Me" onclick= "getValue ();"/>
</form>
</body>
Click to show results: a = undefined b = 5 c = 7 Article One article two article three
The difference between a label's href= "javascript:void (0)" and href= "#"