There is the practice of using a href="#" for creating an interactive element. People disable the default behavior of a link using JS. As a result, you will get an element that behaves like a button. Yes, it's the working solution at first sight. But the problem is this element has not become a button for browsers. If you click a right mouse button on this element you will see the following options in the context menu: "Open link in new tab", "Open link in new window", "Open link in incognito window".
button type=button is better than a href=#
button type=button is better than a href=#
button type=button is better than a href=#
There is the practice of using a href="#" for creating an interactive element. People disable the default behavior of a link using JS. As a result, you will get an element that behaves like a button. Yes, it's the working solution at first sight. But the problem is this element has not become a button for browsers. If you click a right mouse button on this element you will see the following options in the context menu: "Open link in new tab", "Open link in new window", "Open link in incognito window".