Welcome to the Treehouse Community
Looking to learn something new?
Button VS Input tags
Hello, in the HTML course we didn't talk about the
Well, i want to know more about it, what's the deference between
<input>, and when to use this or that ?
in few words you can use the button element for, buttons whit random actions or submit a form, YOU SHOULD NOT use the input element outside a form or for other action than submit/validate a form.
Hope thath helps
Buttons are more flexible. You can put HTML into them to improve your UI - such a tick image on your agree button.
This is why the button tag was originally created:
"Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content. For example, a BUTTON element that contains an image functions like and may resemble an INPUT element whose type is set to “image”, but the BUTTON element type allows content."
There is much richer write up here: Rediscovering the button element
And this is a popular question on stackoverflow so lots of info there as well.