Error regarding label id

Hello, I am just blossoming into coding so forgive me for the mundane.

I am getting errors when running the test saying, " You should have a label element with an id of name-label", as well as, “Your #name-label should contain text that describes the input”.

I have tried a few different approaches, moving sequences, trying for attribute instead of id, I have made no progress towards solving this.

this is what I have written:

<!DOCTYPE html>
<head>
    <link rel="stylesheet" href=""
</head>
<html>
  <h1 id="title">Coolest Trout</title></h1> 
    <p id="description"> This survey is to determine which trout is the coolest of them all</p>
      <section>
        <h2>A brief summary for the unfamiliar.</h2>
        <ul>
        <li>Rainbow Trout:The rainbow trout is called so for its vibrant lateral line. This native to North America is known for its acrobatic displays and inviolable vigor and stamina.</li>
        <li>Brown Trout: The Brown trout often remain concealed from an anglers eye due to their brown to olive base color and preference to lurk in shadowy places a stream provides. Though powerful, Brown trout prefer rogue like tactics to fill their bellies.</li>
        <li>Brook Trout: Not a true trout but a species of char, a cousin of sorts. Brook trout were favorable by government programs as a species of sport fishing, often errupting in population which out competed thousands of miles of native Cutthroat habitat. Opportunists, the Brook trout expresses aggressive approaches towards any snack coming their way.</li>
        <li>Cutthroat Trout: The Cutthroat is the all American classic. Distinct red to orange markings look like slashes underneath the jawline thus giving the name Cutthroat. Big strikes and spirited fights are a guarantee when fishing for Cutthroat.</li>
        </ul> 
        <h3>Honorable Mentions:</h3>
        <ul>
        <li>Golden Trout</li>
        <li>Tiger Trout</li>
        <li>Apache Trout</li>
        <li>Lake Trout</li>
        <li>Apache Trout</li>
        </ul>
    <label>Look Here!</label><br>
<form action="" method="post" id="survey-form">
<div>
<div class="survey-form"
  <label for="name-label">Name</label>
    <input id="name" type="text" placeholder="your name" required><br>
</div>
<div class="survey-form"
  <label for="email-label">email</label>
    <input id="email" type="email" placeholder="your email" required><br>
</div>
<div>
<div class="survey-form"
  <label for="number-label">age</label>
    <input id="number" type="number" min="05" max="99" placeholder="05-99"><br>
</div>
<div>
<div class="survey-form"
</div>
<br>
<br>
<div>
<div class="survey-form"
  <label id="select-label">Which is the coolest trout?</label>
    <select id="dropdown">
      <option>Rainbow Trout</option>
      <option>Brown Trout</option>
      <option>Brook Trout</option>
      <option>Cutthroat Trout</option>
    </select>
        <br>
        <br>
</div>
<div>
  <label>True or False?</label>
    <div>
    <label>Trout can rapidly change color becoming darker when aggressive and lighter when passive,or a response based on the surrounding environment?</label>
    </div>
    <div>
      <label><input type="radio" name="game" value="true">True</label>
    </div>
    <div>
      <label><input type="radio" name="game" value="false">False</label>
    </div>
</div>

    </form>
</html>

I am sure the solution is simple, but I am not seeing it. In advance, thank you for your time.

please post a link to the challenge.

make sure all your html is correct, here you are missing a >

this repeat all over for many other divs

1 Like

Hello!

I think the “for” attribute value should match the “id” value of the input element.
As well, I think the “name-label” should have an “id” within the label element.

I hope this helps you to correct the errors in the label element opening tags.

Keep up the good work.

1 Like