--- id: bad87fee1348bd9aede08830 title: Create a Form Element challengeType: 0 forumTopicId: 16817 --- ## Description
You can build web forms that actually submit data to a server using nothing more than pure HTML. You can do this by specifying an action on your form element. For example: <form action="/url-where-you-want-to-submit-form-data"></form>
## Instructions
Nest the existing input element inside a form element and assign `"https://freecatphotoapp.com/submit-cat-photo"` to the action attribute of the form element.
## Tests
```yml tests: - text: The existing input element should be nested within a form element. testString: const inputElem = document.querySelector('form input'); assert(inputElem.getAttribute('type') === 'text' && inputElem.getAttribute('placeholder') === 'cat photo URL'); - text: Your form should have an action attribute which is set to https://freecatphotoapp.com/submit-cat-photo testString: assert($("form").attr("action") === "https://freecatphotoapp.com/submit-cat-photo"); - text: Your form element should have well-formed open and close tags. testString: assert(code.match(/<\/form>/g) && code.match(/
/g) && code.match(/<\/form>/g).length === code.match(//g).length); ```
## 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
```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

Top 3 things cats hate:

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