freeCodeCamp Challenge Guide: Set the ID of an Element

freeCodeCamp Challenge Guide: Set the ID of an Element
0

#1

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">

#2

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


#3

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.

Cheers!


#4

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


#5

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


#6

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


#7

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

under

thanking You
Shawn Alexander


#8

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


#9

This worked too:

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