--- id: bad87fee1348bd9aedd08830 title: フォームに送信ボタンを追加する challengeType: 0 videoUrl: 'https://scrimba.com/p/pVMPUv/cp2Nkhz' forumTopicId: 16627 dashedName: add-a-submit-button-to-a-form --- # --description-- `submit` (送信) ボタンをフォームに追加しましょう。 このボタンをクリックすると、フォームの `action` 属性で指定した URL にフォームのデータが送信されます。 こちらが送信ボタンの例です: ```html this button submits the form ``` # --instructions-- `form` 要素内の最後の要素として `submit` タイプのボタンを追加してください。ボタンのテキストは `Submit` としてください。 # --hints-- `form` の中に `button` が必要です。 ```js assert($('form').children('button').length > 0); ``` 送信ボタンは `type` 属性を `submit` に設定する必要があります。 ```js assert($('button').attr('type') === 'submit'); ``` 送信ボタンのテキストは `Submit` にしてください。 ```js assert( $('button') .text() .match(/^\s*submit\s*$/gi) ); ``` `button` 要素には終了タグが必要です。 ```js assert( code.match(/<\/button>/g) && code.match(//g).length === code.match(/CatPhotoApp Click here to view more cat photos. Things cats love: cat nip laser pointers lasagna Top 3 things cats hate: flea treatment thunder other cats ``` # --solutions-- ```html CatPhotoApp Click here to view more cat photos. Things cats love: cat nip laser pointers lasagna Top 3 things cats hate: flea treatment thunder other cats Submit ```
Click here to view more cat photos.
Things cats love:
Top 3 things cats hate: