--- id: bad87fee1348bd9aedd08830 title: Add a Submit Button to a Form challengeType: 0 guideUrl: 'https://chinese.freecodecamp.org/guide/certificates/add-a-submit-button-to-a-form' videoUrl: '' localeTitle: 向表单添加提交按钮 --- ## Description
我们在表单中添加一个submit按钮。单击此按钮会将表单中的数据发送到您使用表单的action属性指定的URL。这是一个示例提交按钮: <button type="submit">this button submits the form</button>
## Instructions
添加一个按钮作为form元素的最后一个元素,其类型为submit ,并且“Submit”作为其文本。
## Tests
```yml tests: - text: 你的表单里面应该有一个按钮。 testString: 'assert($("form").children("button").length > 0, "Your form should have a button inside it.");' - text: 您的提交按钮应该具有要submit的属性type 。 testString: 'assert($("button").attr("type") === "submit", "Your submit button should have the attribute type set to submit.");' - text: 您的提交按钮应该只有“提交”文本。 testString: 'assert($("button").text().match(/^\s*submit\s*$/gi), "Your submit button should only have the text "Submit".");' - text: 确保您的button元素有一个结束标记。 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 ```