Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialArikaturika Tumojenko
8,897 PointsThe difference between <input type="submit"> and <button type="submit">?
I had issues understanding why in the previous video we were styling elements that didn't exist on the page (respectively the button element) until I realized that <input type="submit" value="login"> it counts as a button.
In the "HTML forms" track (with Nick Pettit) I only saw this form
<button type="submit">Sign up</button>
IS there a real difference between them. Are they used in different circumstances? When do we use the input tag and when do we use the button tag? Thank you!
2 Answers
Travis Alstrand
Treehouse TeacherIf anyone else is curious about this, I found this Stack Overflow page with a lot of handy info on this topic here you go
Ben Schroeder
22,818 PointsYou can put HTML in a <button>, which is very handy for design.
Christian Lawrence
3,941 PointsChristian Lawrence
3,941 PointsMy understanding of this is that the <button> tag is for on page interactions only e.g. postcode look up. Whereas, <input type="submit" value="login"> sends data but also moves the user to another screen e.g. my account.