Search⌘ K

Building the Form

Explore the process of building auto-validating forms by using semantic HTML tags like form, fieldset, and label for accessibility and usability. Understand the benefits of semantic elements over plain divs, and learn how to implement custom dropdown menus with JavaScript to enhance user experience and ensure form data submission.

The HTML

We’ll start with the HTML and layout some basic elements for us to work with.

In general, as you​’re developing on the frontend, you’ll find an iterative process with short feedback loops to be the fastest way of progressing. If you’re building a JavaScript library, that means continuously​ console.loging or writing small tests after completion of a piece. In our case, we’re working towards validating inputs, so it makes sense to have some to work with.

<div> vs <label>

Forms are an exciting part of HTML with many surprises. You might have seen ...