DEV Community

Discussion on: CSS can help improve your HTML⁉ - Ep 2: buttons and links.

Collapse
 
alvaromontoro profile image
Alvaro Montoro

I'm going to play devil's advocate here... how about a link to an external login site? A redirection to another site with a token and information, that will go back to our site eventually once it is validated. Should it be an <a> or a <button>? It is a redirection, so it seems like <a> would be a better option, but should it look like a button or like a link? After all, if it was an actual login form, it would be a <button>, no?

Collapse
 
loucyx profile image
Lou Cyx • Edited

I guess could be a button inside a form with the action set to the target URL, and a bunch of hidden fields with the data you want to pass to the target URL. If you want to use JS, you could just do the redirect from the click event of said button.