What does href = # In the link mean,

Source: Internet
Author: User

What does href = # In the link mean,

Link to the current page.
-------------------
It is usually used as follows::
<A href = "#" onclick = "window. close ()"> close </a>
Linking href = "#" means connecting to the current page is meaningless, and the page will not be refreshed. The key is the onclick next. When you click "close", the window will be executed. close () code.

You may say why not directly write <a onclick = "window. close ()"> close </a>
If the two words are written in this way, they will not be processed as superlinks, and the effect will look worse. You can try it on your own. When creating a webpage, the parameters in the html language are used to specify the url ### of the link, that is, the link to this page, and href = "Address" is the link to this page. The default page is displayed, A new window is not displayed. If # is removed when the connection is null, the mouse and hand cursor are not displayed. Generally, it is a fake link pointing to this page.
You can also keep up with the anchor id behind #. This is actually another usage of bookmarks.

Create bookmarks
Syntax: <a name = "bookmarkname"> text </a>
Bookmarks linked to the same page (use)
Syntax: <a href = "# bookmark name"> link text </a>
Bookmarks linked to different pages
Syntax: <a href = "link file address # bookmarkname"> link text </a> (note the quotation marks and)

Under normal circumstances, click the <a href = "# bookmark name"> link text </a> link, the cursor will automatically jump to the following page: <a name = "bookmarkname"> text </a>.

However, you can write it as <a href = "#"> link text </a> without writing a bookmarked name, it is actually nothing to jump. Generally, href = "#" is returned only when <a onclick = ""> "#"
When the link is empty, the display will show the effect of The Link (for example, the mouse becomes a small hand), but there is no page Jump.

 

From: http://www.jb51.net/web/69028.html

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.