Click the hyperlink to skip. Click the hyperlink to jump

Source: Internet
Author: User

Click the hyperlink to skip. Click the hyperlink to jump

1. <a href = "####"> </a> or <a href = "# all"> </a>

2. <a href = "javascript: void (0)"> </a>

3. <a href = "javascript: void (null)"> </a>

4. <a href = "javascript:;"> </a>

5. <a href = "#" onclick = "return false"> </a>

Note:

First, using javascript: void (0) directly by Link (href) in IE may cause some problems, such as: causes the GIF animation to stop playing, the safest way is to use "#". To prevent the link from jump to the top, The onclick event return false.

Javascript: void (expression) or javascript: void expression

Second, use the void operator to specify the hyperlink. The expression is calculated, but no content is loaded in the current document.

// When a user clicks a link, void (0) is calculated as 0, but it has no effect on JavaScript. <A href = "javascript: void (0)"> click here. </A>

// Create a hyperlink. The form is submitted when you click it. <A href = "javascript: void (document. form. submit ()"> click here to submit A form </A>




Do not jump to hyperlink

<A href = "#"> </a>
<A href = "javascript:;"> </a>
<A href = "javascript: void (0);"> </a>
The above methods are acceptable. We recommend two or three methods. The first method page may jump to another location.

Why does html not jump when a hyperlink is clicked?

<A href = "index. php" target = _ blank class = "slide-btn"> link </a>

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.