# What's the difference between \<input type=submit\> and \<button\>

**URL:** <https://forum.freecodecamp.org/t/whats-the-difference-between-input-type-submit-and-button/312746>\
**Category:** Curriculum Help\
**Tags:** css, html\
**Created:** [September 7, 2019, 12:58pm UTC](https://forum.freecodecamp.org/t/whats-the-difference-between-input-type-submit-and-button/312746 "2019-09-07T12:58:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![martaramos](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@martaramos](https://forum.freecodecamp.org/u/martaramos)\
**Post date:** [September 7, 2019, 12:58pm UTC](https://forum.freecodecamp.org/t/whats-the-difference-between-input-type-submit-and-button/312746/1 "2019-09-07T12:58:11Z")

</div>

What’s the difference between  
`<input type="submit" value="Get Started">`  
and  
`<button> Get Started </button>`

---

<div class="post-metadata">

**Author:** ![codename11](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/codename11/32/85412_2.png) [@codename11](https://forum.freecodecamp.org/u/codename11)\
**Post date:** [September 7, 2019, 1:13pm UTC](https://forum.freecodecamp.org/t/whats-the-difference-between-input-type-submit-and-button/312746/2 "2019-09-07T13:13:45Z")

</div>

First one can be multiple types including button, second can be only button.

---

<div class="post-metadata">

**Author:** ![martaramos](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@martaramos](https://forum.freecodecamp.org/u/martaramos)\
**Post date:** [September 7, 2019, 1:16pm UTC](https://forum.freecodecamp.org/t/whats-the-difference-between-input-type-submit-and-button/312746/3 "2019-09-07T13:16:02Z")

</div>

So they work exactly the same?

---

<div class="post-metadata">

**Author:** ![design](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@design](https://forum.freecodecamp.org/u/design)\
**Post date:** [September 7, 2019, 1:20pm UTC](https://forum.freecodecamp.org/t/whats-the-difference-between-input-type-submit-and-button/312746/4 "2019-09-07T13:20:17Z")

</div>

`input` is used for write data there in this case submit is used as button to send the form but same can do with `<button type="submit">go</button>` and the button is just a button. Both case can make a styled input or button to click to send!

---

<div class="post-metadata">

**Author:** ![codename11](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/codename11/32/85412_2.png) [@codename11](https://forum.freecodecamp.org/u/codename11)\
**Post date:** [September 7, 2019, 1:47pm UTC](https://forum.freecodecamp.org/t/whats-the-difference-between-input-type-submit-and-button/312746/5 "2019-09-07T13:47:26Z")

</div>

On surface and only if the input is of `type="button"`. Also inputs have name and value attributes which is needed inside a form for sending to a backend handler. input type doesn’t need to be a submit if you use ajax.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [March 9, 2021, 11:25am UTC](https://forum.freecodecamp.org/t/whats-the-difference-between-input-type-submit-and-button/312746/6 "2021-03-09T11:25:27Z")

</div>

Closed on March 9, 2021, 11:25am UTC


