When should I use a button (<button>) or a link () in HTML?

后端 未结 1 1167
逝去的感伤
逝去的感伤 2020-12-25 09:59

I was reading the Bootstrap documentation about the button tags (http://getbootstrap.com/css/#buttons-tags), as

相关标签:
1条回答
  • 2020-12-25 10:39

    Thanks to the comments on my question, this is the answer I believe to be true :

    I have to use <a> for links and navigation between page / views.

    I have to use <button> for actions, for example on the current page : validating/resetting a form, showing a modal...

    0 讨论(0)
提交回复
热议问题