A tag in JavaScript and void

Source: Internet
Author: User

1 <Body>2 <ahref= "javascript:;">Point No response</a>3 <ahref= "javascript:void (0);">Point No response</a>4 <ahref= "javascript:void (Alert (' click Message ')");>Click the popup message, do not jump</a>5 6 <ahref= "void (0)">Click to jump to/void (0)</a>7 <ahref= "alert (' click Message ')">Click to jump to/alert (' click Message ')</a>8 <aonclick= "alert (' click Message ')"href= "void (0)">Click to play the message first, then jump to/void (0)</a>9 Ten <aonclick= "alert (' click Message '); return false"href= "void (0)">Click to play the message, do not jump</a> One </Body>

javascript: is a protocol that represents the execution of JS code.

href="javascript:;" is to remove the default behavior of the a tag, as with href="javascript:void (0)".

In JavaScript, Void is an operator that specifies that an expression is evaluated but does not return a value.

A tag in JavaScript and void

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.