--- id: bad87eee1348bd9aede07836 title: Establece el id de un elemento challengeType: 0 videoUrl: 'https://scrimba.com/c/cN6MEc2' forumTopicId: 18279 dashedName: set-the-id-of-an-element --- # --description-- Además de las clases, cada elemento HTML también puede tener un atributo `id`. Existen varios beneficios de usar atributos de `id`: Puedes usar un `id` para dar estilo a un elemento específico; más adelante aprenderás que puedes usar atributos "id" para seleccionar y modificar elementos específicos por medio de JavaScript. Los atributos `id` deben ser únicos. Los navegadores no verifican esta regla, pero es una buena práctica ampliamente aceptada. Entonces, por favor ten cuidado de no asignar a más de un elemento el mismo atributo `id`. A continuación te mostramos un ejemplo de cómo asignar a tu elemento `h2` el id `cat-photo-app`: ```html

``` # --instructions-- Asigna a tu elemento `form` el id `cat-photo-form`. # --hints-- Tu elemento `form` debe tener el id `cat-photo-form`. ```js assert($('form').attr('id') === 'cat-photo-form'); ``` # --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


```