Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I can' t make the second fieldset appear

Hi guys I wanted to ask a question, I was doing the FCC survey exam and while I was adding some inputs in the second fieldsets I noticed that the page doesn’t let me see it.. any advise? Here is my code, I’ m writing it on CodePen:

https://codepen.io/AlexEffe/pen/LYdKoEE–

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

  • It’s just because you are missing to close many elements in your code.
  • Morover you do not need to wrap your input in label tags, html has for attribute with label tagw which help you to link, label with correct input field. The only logic is id attribute of that input should match with the for attribute of label.
  • And please be careful while closing tags you are starting the tags but not closing them that’s the reason your second fieldset was not appearing. and also visit this post for more knowledge.
body {}

label {
  display: block;
  margin: 0.5rem;
}
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title> Whats your favourite videogame?</title>
  <link rel="stylessheet" href="styles.css">
</head>

<body>
  <h1 id="title"> WHATS YOUR FAVOURITE VIDEOGAME?</h1>
  <p id="description"> Please fill up the survey to help find the most popular videogames </p>
  <form id="survey-form">
    <fieldset>
      <label for="name">Name: </label><input id="name" type="text" required />
      <label for="age">Age (optional):</label> <input id="age" type="number" min="10" max="120" />
      <label for="email">Email:</label> <input id="email" type="email" required />
      <label for="job">What do you do for living?</label>
      <select id="job">
        <option value ""> (Select one) </option>
        <option value "1"> Student </option>
        <option value "2"> Full time job </option>
        <option value "3"> Prefer not to say </option>
        <option value "4"> Other </option>
      </select>
    </fieldset>

    <fieldset>
      <label for="money">How much do you play?</label> <input id="money" type="text">
    </fieldset>
  </form>
</body>

</html>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading