Doubts in #story10 in SurveyForm

In the survey form project,
I can’t understand the #story10 .
the piece of code:

Name:

where specifies the parent of the by using the id=“name>” inside the input type=“text”

Then my doubts are:
*****What is the use of id=“name-label” and if it is so do we need to give any styles to it in style sheet??
*****why is the comes before .It should come after the
tag

id is an attribute. id can be used as a selector to style elements and maipulate the element in javascript. id should be unique per element.

1 Like

then what is the use of “name-label”

It’s the value of the id.

/* use of id */
#awesome-paragraph {
    color: red;
}
<p id="awesome-paragraph">Hi</p> <!-- Red Color would be applied for this paragraph due to id --> 
<p>Hey</p>

oh I understood now Thanks a ton

1 Like