Re:The unreasonable effectiveness of simple HTML
by DCoder on Thursday January 28, 2021 @12:59AM
(#25938741)
> use either an <a> or a <button>
Generally, it should be noted that an <a> tag is only appropriate if it makes sense to right-click this element and get options to "open in new tab" or "add to bookmarks". All the stupid "buttons" implemented as <a href="#"> + e.preventDefault() need to die.
Re:The unreasonable effectiveness of simple HTML
by trissylegs on Sunday January 31, 2021 @10:39PM
(#25985276)
Yea I use <a> if it's a navigation button for react-router. But it still shows up like a URL because we're using the Browser history (it just updates the URL and renders the new page, each route has a URL and resource id's are in the url).
As opening the URL directly should work (if authenticated) it makes sense to use <a> tags.
Gahhh. I use either an <a> or a <button> and put style on it. Has all the same visual appeal of the equivalent div. But it already is a button.