What does href = # in the link mean

Link to the current page.
-------------------
usually the following uses:
<a href="#" onclick="window.close()"> </a> off
the href = " # "Refers to the connection to the current page, which is meaningless, and the page will not be refreshed. The key is the onclick behind. When" Close "is clicked, the window.close () code will be executed.

You might say why not write it directly as <a onclick="window.close()"> Close </a>.
If you write it like this, closing these two words will not be treated as a hyperlink, and the effect will look worse. You can try it yourself. The parameters in the html language when creating a web page are used to specify the URL of the link #### is the link to this page, href = "address" is the link to the address link to the default page of this page, no new window pops up, when empty connection, If # is removed, the mouse hand cursor is not displayed. The popular thing is a fake links pointing to the page
can also keep up with the anchor id # this is actually behind another use a bookmark

Create bookmark
syntax: <a name="bookmark name"> text </a>
bookmark (application)
syntax linked to the same page : <a href="#bookmark name"> linked text </a>
link to different page bookmarks
syntax: <a href="链接文件的地址#书签名称"> link text </a> (note the quotes and #)

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

But if you write: <a href="#"> linked text </a> without writing the bookmark name, it is actually nothing. Generally, it will only go to href = "#"
when you are <a onclick=""> you write it as if it is an empty link and display it as a link effect (such as the mouse becomes a small hand) but there is no page jump

Guess you like

Origin www.cnblogs.com/kevinlucky/p/12686640.html