I don’t understand what my code is missing, everything seems to be working fine but the parts which the challenge says I am missing are:
-
You should have a
label
element with anid
ofname-label
. -
You should have a
label
element with anid
ofemail-label
. -
You should have a
label
element with anid
ofnumber-label
. -
Your
#name-label
should contain text that describes the input.
*Your #email-label
should contain text that describes the input.
-
Your
#number-label
should contain text that describes the input. -
Your
#name-label
should be a descendant of#survey-form
. -
Your
#email-label
should be a descendant of#survey-form
.
*Your #number-label
should be a descendant of #survey-form
.
Should I just re-start the challenge? Whenever I change the id to ‘name-label’ it then states that my input element should have an id of ‘name’. I’m really confused.
This is my code so far:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=UTF-8></meta>
<title>Survey Form</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1 id="title" >Survey Form</h1>
<p id="description" >Thank you for completing our form</p>
<form id="survey-form">
<fieldset>
<label for="name-label">Enter Your First Name: <input id="name" #name-label type="text" required <textarea id="bio" name="bio" rows="3" cols="30" placeholder="Jane"></textarea></label>
<label for="number">Enter Your Age: <input id="number" name="number" type="number" min="13" max="99" required <textarea id="bio" name="bio" rows="3" cols="30" placeholder="20"></textarea></label>
<label for="email">Enter Your Email: <input id="email" name="email" type="email" required <textarea id="bio" name="bio" rows="3" cols="30" placeholder="Jane123@email.com"></textarea></label>
<label for="new-password">Create a New Password: <input id="new-password" name="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label>
<label for="terms-and-conditions">
<input id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" class="inline" value="1" /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
</fieldset>
<fieldset>
<label for="languages">Select all that apply</label>
<label for="html"><input id="html" type="radio" name="radio" class="inline" value="1" /> HTML</label>
<label for="java"><input id="java" type="radio" name="radio" class="inline" value="2"/> Java</label>
<label for="python"><input id="python" type="radio" name="radio" class="inline" value="3"/> Python</label>
<label for="other"><input id="other" type="radio" name="radio" class="inline" value="4"/> Other</label>
<label
<label
<label for="bio">If other, what languages does that include?
<textarea id="bio" name="bio" rows="3" cols="30" placeholder="I also know..."></textarea>
</label>
</fieldset>
<fieldset>
<label for="dropdown">How did you hear about us?
<select id="dropdown" name="referrer">
<option value="">(select one)</option>
<option value="1">Social Media</option>
<option value="2">Google Search</option>
<option value="3">Word Of Mouth</option>
<option value="4">Other</option>
</select>
</label>
</fieldset>
<fieldset>
<label for="reccomendation">Would you reccomend this survey to a friend? </label>
<label for="reccomendation"> <input id="reccomendation" type="checkbox" required name="reccomendation" class="inline" value="1" /> Yes </label>
<label for="reccomendation"> <input id="reccomendation" type="checkbox" required name="reccomendation" class="inline" value="2" /> No </label>
</fieldset>
<input id="submit" type="submit" value="Submit" />
</form>
</body>
</html>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Challenge: Survey Form - Build a Survey Form
Link to the challenge: