freeCodeCamp Challenge Guide: Set the ID of an Element

freeCodeCamp Challenge Guide: Set the ID of an Element


In addition to classes, each HTML element can also have an id attribute.

There are several benefits to using id attributes, and you’ll learn more about them once you start using jQuery.

id attributes should be unique. Browsers won’t enforce this, but it is a widely agreed upon best practice. So please don’t give more than one element the same id attribute.

Here’s an example of how you give your h2 element the id of cat-photo-app:

<h2 id="cat-photo-app">


There is no hint but simply a repeat of the instructions. ???


Not sure about you guys but I kept putting in the title of the example and not what they wanted me to put in. I kept putting “cat-photo-app” and not “cat-photo-form”.

Also, drop the addition of “form id=blahblahblah” and just put “id=blah” right after the action element but before the end arrow.

“form action=”/submit-cat-photo" id=“cat-photo-form” " Minus the outside quotes obviously.



Thank You Stratus41298; that helped me a lot! I appreciate your help!:computer:


You’re welcome! It’s always important to contribute when you’ve had a hard challenge.


Hahaha! Stratus41298 for some reason I was typing cat-photo-app too! :smiley: Hmm strangely it’s not only me


Hey try this out :slight_smile: 100% it works.


thanking You
Shawn Alexander


Thank you, it worked but I don’t understand why it works with NO quotation marks while the class action="/submit… HAS quote marks!!!


This worked too:

I think I'll try without quotation marks, too!