Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Forms Form Basics The Button Element

Elena Paraschiv
Elena Paraschiv
9,938 Points

What is the difference between in input type="submit" & button type="submit"

They both display the same. Is there any difference between the two? <input type="submit" value="Continue"> <button type="submit">Continue</button>

1 Answer

Austin Whipple
Austin Whipple
29,712 Points

When used with forms, they're largely interchangeable (as long as you include the appropriate type and value on the button) with buttons being (I believe) the newer option. Buttons are also more versatile and can be used to attach any sort of JavaScript functionality to. Check out this W3C article and this Stackoverflow question about them.