The href attribute of the 1.<a> tag specifies that the value of the Url,href property of the hyperlink target can be a relative or absolute URL for any valid document, including fragment identifiers and JavaScript code snippets. href= "javascript:", where JavaScript: is a pseudo-protocol that allows us to invoke JavaScript functions via a link. And in this way javascript: can implement a-tag click event Runtime, if the page content is many, When there are scrollbars, the page does not jump and the user experience is better.
href= "javascript:" This is an empty statement in itself. Simply put, this a-tag click link is out of action
2.href= "javascript:" The main role makes it a hyperlink style, it looks like a button, there is action is not text, in fact, is linked to an empty statement, the general set onclick event.
Label in HTML means a hyperlink
1 The general role of the jump page needs to set the jump page is to set the address to jump in the href attribute
2. As a button to use, you can click but do not jump to the page but do other processing, you need to set the href attribute to javascript:
JavaScript: Indicates that this is an empty connection. No response after clicking.
It's like #, but a # Click will roll to the top after a long page, and JavaScript: there's no such thing. He is still in the current position after testing.
Of course # # #这样的效果就跟javascript: the same
href= the difference between "#" and href= "javascript:"