Why (and how) do we build a dropdown in "Build a Survey Form"?

Tell us what’s happening:
Hi, why are we required to build a dropdown for this project? I was under the impression that it was to be done after we finished the HTML and CSS course. But that does not cover JavaScript. I write this question because I am confused as to why they made taht a requirement, and for someone to explain to me how it all works.

Your code so far

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/responsive-web-design-projects/build-a-survey-form

1 Like

The Free Code Camp is designed so that sometimes you have to reach outside what is taught and find another resource to learn some concepts/syntax. Actually, the Free Code Camp Guide as a section on dropdowns (see here).

You do not need to know JavaScript to create a dropdown menu. It is pure HTML code.

You can also use CSS to create a dropdown as seen in the guide here.

1 Like

You can easily build a dropdown menu using an option tag

Learn more about it here: option tag

Provided you with an example below:

<div class="dropdown">
      <select id="dropdown">
        <option value="cplusplus">C++</option>
        <option value="csharp">C#</option>
        <option value="java">Java</option>
        <option value="javascript">JavaScript</option>
      </select>         
    </div>
3 Likes