curriculum/challenges/english/blocks/learn-html-forms-by-building-a-registration-form/60f5d2776c854e069560fbe6.md
The first fieldset will hold name, email, and password fields. Start by adding four label elements to the first fieldset.
There should be three fieldset elements in total.
assert.equal(document.querySelectorAll('fieldset')?.length, 3);
The fieldset elements should all be direct children of the form element.
assert.equal(document.querySelectorAll('form > fieldset')?.length, 3);
The four label elements should all be direct children of the first fieldset element. Make sure you close the label elements.
assert.equal(document.querySelectorAll('form fieldset:first-child > label')?.length, 4);
The last two fieldset elements should be empty.
const LastTwoFieldsetElements = Array.from(document.querySelectorAll("form fieldset:not(fieldset:first-child)"));
assert.isTrue(LastTwoFieldsetElements.filter((ele) => ele.innerHTML?.replace(/\s/g, ""))?.length === 0);
Make sure you close the label elements.
assert.lengthOf(document.querySelector('fieldset')?.innerHTML?.match(/<\/label>/g), 4)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Registration Form</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<h1>Registration Form</h1>
<p>Please fill out this form with the required information</p>
--fcc-editable-region--
<form method="post" action='https://register-demo.freecodecamp.org'>
<fieldset>
</fieldset>
<fieldset></fieldset>
<fieldset></fieldset>
</form>
--fcc-editable-region--
</body>
</html>
body {
width: 100%;
height: 100vh;
margin: 0;
background-color: #1b1b32;
color: #f5f6f7;
}