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
--- id: bad87eee1348bd9aede07836 title: Impostare l'id di un elemento challengeType: 0 videoUrl: 'https://scrimba.com/c/cN6MEc2' forumTopicId: 18279 dashedName: set-the-id-of-an-element --- # --description-- Oltre alle classi, ogni elemento HTML può avere anche un attributo `id`. Ci sono diversi vantaggi ad usare gli attributi `id`: puoi usare un `id` per stilizzare un singolo elemento, e in seguito imparerai che puoi usarli per selezionare e modificare elementi specifici con JavaScript. Gli attributi `id` dovrebbero essere unici. I browser non applicano questa regola rigorosamente, ma è una buona pratica largamente accettata. Quindi non dare a più di un elemento lo stesso attributo `id`. Ecco un esempio di come fornire al tuo elemento `h2` l'id di `cat-photo-app`: ```html
Click here to view more cat photos.
Things cats love:
Top 3 things cats hate:
Click here to view more cat photos.
Things cats love:
Top 3 things cats hate: