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 trial

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,725 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.