--- id: bad87fee1348bd9aede08830 title: Crea un elemento de formulario challengeType: 0 forumTopicId: 16817 dashedName: create-a-form-element --- # --description-- Puedes construir formularios web que realmente envíen datos a un servidor usando sólo HTML puro. Puedes hacer esto especificando un atributo `action` en tu elemento `form`. Por ejemplo: ```html
``` # --instructions-- Anida el elemento `input` existente dentro de un elemento `form` y asigna `"https://www.freecatphotoapp.com/submit-cat-photo"` al atributo `action` del elemento `form`. # --hints-- El elemento `input` existente debe anidarse dentro de un elemento `form`. ```js const inputElem = document.querySelector('form input'); assert( inputElem.getAttribute('type') === 'text' && inputElem.getAttribute('placeholder') === 'cat photo URL' ); ``` Tu formulario `form` debe tener un atributo `action` que esté establecido como `https://www.freecatphotoapp.com/submit-cat-photo`. ```js const action = $('form').attr('action'); assert(action.match(/^https:\/\/(www\.)?freecatphotoapp\.com\/submit-cat-photo$/i)) ``` Tu elemento `form` debe tener etiquetas correctamente abiertas y cerradas. ```js assert( code.match(/<\/form>/g) && code.match(/
/g) && code.match(/<\/form>/g).length === code.match(//g).length ); ``` # --seed-- ## --seed-contents-- ```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
``` # --solutions-- ```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
```