After the OnClick method is added to the a tag, the OnClick method is executed before the action of the property corresponding to the A-tag href is executed, and false is used as the return value if you do not want to perform the href attribute.
<href= "http://www.cnblogs.com/qisel/" onclick= "method (); return false; " > Click </a>
1. None of the above is performed regardless of the HREF attribute action.
2. The following is the ability to determine whether the link in the href attribute is executed, based on the return true or false , after the JS check.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en"><HTML> <HEAD> <TITLE>New Document</TITLE> <METANAME= "Generator"CONTENT= "EditPlus"> <METANAME= "Author"CONTENT=""> <METANAME= "Keywords"CONTENT=""> <METANAME= "Description"CONTENT=""> </HEAD> <BODY> <ahref= "http://www.cnblogs.com/qisel/"onclick= "Return method ()">Click</a> </BODY> <SCRIPTLANGUAGE= "JavaScript"> functionmethod () {if(1 == 0){ return true; }Else{ return false; } } </SCRIPT></HTML>
An onclick event in the A tag that determines whether a link to a tag is executed based on the check case in the event