--- id: bad87fee1348bd9aedd08830 title: Add a Submit Button to a Form challengeType: 0 guideUrl: 'https://www.freecodecamp.org/guide/certificates/add-a-submit-button-to-a-form' videoUrl: 'https://scrimba.com/p/pVMPUv/cp2Nkhz' --- ## Description
Let's add a submit button to your form. Clicking this button will send the data from your form to the URL you specified with your form's action attribute. Here's an example submit button: <button type="submit">this button submits the form</button>
## Instructions
Add a button as the last element of your form element with a type of submit, and "Submit" as its text.
## Tests
```yml tests: - text: Your form should have a button inside it. testString: assert($("form").children("button").length > 0, 'Your form should have a button inside it.'); - text: Your submit button should have the attribute type set to submit. testString: assert($("button").attr("type") === "submit", 'Your submit button should have the attribute type set to submit.'); - text: Your submit button should only have the text "Submit". testString: assert($("button").text().match(/^\s*submit\s*$/gi), 'Your submit button should only have the text "Submit".'); - text: Make sure your button element has a closing tag. testString: assert(code.match(/<\/button>/g) && code.match(/
## Challenge Seed
```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```
## Solution
```js // solution required

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```