Survey Form - Build a Survey Form

Need help with these

  • Failed:You should have an h1 element with an id of title.

  • Failed:Your #title should not be empty.

  • Failed:You should have a p element with an id of description.

  • Failed:Your #description should not be empty.

  • Failed:You should have a form element with an id of survey-form.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html> <html lang="en">
<head>
  <link rel="stylesheet" href="styles.css">
</head>

<body>
<h1><id="title">Survey Form</h1>

<p><id="#description">Description</p>

<form><id="#survey-form"><input id="name"></form>





</body>

























</html>
/* file: styles.css */
#title {

}



Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

Challenge: Survey Form - Build a Survey Form

Link to the challenge:

You have no title element which is why thats marked as being wrong, and you also are not using the id correctly in almost every place. Look at your input, its the one place you can see the id being added correctly

I’m sort of confused because it says I should have an ID element with an id of title and that my #title should not be empty but doesnt mention having a title element anywhere

Screenshot (334)
This is what I put but it is still incorrect

Is anyone active to reply?

Let me get to it in a few. Is this the whole code? Cause you have many incomplete tasks which I cannot take for you.

1 Like

I need help with these

  • Failed:You should have an h1 element with an id of title.
  • Failed:Your #title should not be empty.

Again, this is not how you add an id. Look at your input on how to do it correctly

Title should not be in your h1. It might be good for you to go back and look at some of the earlier html lessons. Title goes between the head tags

1 Like

Screenshot (335)

I did it the same way as my form but it’s still incorrect.

  • have an h1 element with an id of title.

  • Failed:Your #title should not be empty.

Can you help me out please.

Look at your input and h1. See how you are trying two different ways to add an id? Your input is correct, but h1 is wrong

Also you cant have multiple ids with the same name like you are trying to do. What do the directions say should have the id of title?

Your input also shouldnt be inside your h1. You can have text inside an h1 but having an element inside it is something you wouldnt do

1 Like

It seems like you’re using the id attribute as if it were an independent element when you intend to associate the id attributes with their respective elements. Attributes should be contained within the same <> tag as their associated elements. You do this correctly in your input element, where you create the element and assign it an ‘id=“name”’ attribute within the same <> tag.

Additionally, when the instructions state something like “your #title should not be empty”, the “#title” is simply referring to the element which has an id value of “title”. For example, your input element with an id value of “name” could be selected in CSS with the #name selector. Thus, once you successfully assign the proper id values to your elements and give the elements some content, these issues should be fixed.

Good luck!

1 Like

Thank you passed now

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.