1. The href attribute of the label specifies that the value of the Url,href property of the hyperlink can be an absolute or relative URL for any valid document, including fragment identifiers and JavaScript code fragments;
1 <a id= "wrap" href= "javascript:;" > Enter Password </a>
2, javascript: is a pseudo-protocol, the other pseudo-protocol also has mail:tel:file:
JavaScript: Represents a piece of code that executes when clicked, and javascript:; means nothing happens when clicked, so there's nothing to do when you click
1 document.getElementById (' wrap '). AddEventListener (' Click ', Fumction (e) {2 E.preventdefault (); 3 // when <a> triggers, processing business 4 },false);
JAVASCRIPR: is to remove the default behavior of <a> tags, and href= "javascript:void (0)"; Void is an operator of JavaScript, void (0) means nothing.
3, in simple terms, "javascript:" "is another kind of nested JS code in the Web page way, and through the tag to add the same JS code, but it is not recommended to use
If you click on the link below, JavaScript will be executed: the following code
1 <a href= "Javascripe:alert (22);" > Click here </a>
href= "javascript:;"