https://css-tricks.com/use-button-element/
https://css-tricks.com/a-bit-on-buttons/
https://css-tricks.com/use-button-element/
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_button_role
Utilizare taguri pentru butoane in Html:
1. De navigare catre alta pagina, se realizeaza cu: <a>link</a>
Ex de <a> tags:
- A search button (normally triggers a type-ahead ajax-search thingy - but the href could just point to a /search/ page.)
- A publish button (triggers the next stage of publishing something a user built - but the href could just point to a /publish/ page.)
- A thumbnail button (opens a lightbox with a larger version - but the href could just point to the URL of that larger version.)
Ex: <a href="#meaningful" class="button" role="button">
I'm good
</a>
2. De manipulare alte elemente din pagina, cu ajutorul Javascript, de exemplu sa deschida/ inchida popup sau meniu; se foloseste tag <button>.
- Buttons are used to create features that rely on Javascript.
- Behaviours such as revealing a menu or showing a date picker.
3. De trimitere a unui formular catre server.
Ex: <input type="submit" value="Trimite"/>
- Buttons within a <form> have functionality without JavaScript, but that is the only place.
Meaning, a <button> is entirely useless in HTML unless JavaScript is successfully downloaded and executed.
Taken to an extreme logical conclusion, you should never use a <button> (or type="button") in HTML outside of a form. Since JavaScript is required for the button to do anything, you should inject the button into place with JavaScript once its functionality is already ready to go.
- Submit buttons shouldn’t have a hand cursor