2.4 KiB
2.4 KiB
id | title | challengeType | dashedName |
---|---|---|---|
60fac4095512d3066053d73c | Step 29 | 0 | step-29 |
--description--
Aggiungere al modulo un menu a discesa è piuttosto facile con l'elemento select
. L'elemento select
è un contenitore per un gruppo di elementi option
e l'elemento option
funge da etichetta per ciascuna opzione a discesa. Entrambi gli elementi richiedono tag di chiusura.
Inizia aggiungendo un elemento select
sotto i due elementi label
. Poi, annida 5 elementi option
all'interno dell'elemento select
.
--hints--
Dovresti aggiungere un elemento select
al terzo fieldset
.
assert.exists(document.querySelector('fieldset:nth-child(3) > select'));
Dovresti annidare 5 elementi option
all'interno dell'elemento select
.
assert.equal(document.querySelectorAll('fieldset:nth-child(3) > select > option')?.length, 5);
--seed--
--seed-contents--
<!DOCTYPE html>
<html>
<head>
<title>Registration Form</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<h1>Registration Form</h1>
<p>Please fill out this form with the required information</p>
<form action='https://register-demo.freecodecamp.org'>
<fieldset>
<label>Enter Your First Name: <input type="text" required /></label>
<label>Enter Your Last Name: <input type="text" required /></label>
<label>Enter Your Email: <input type="email" required /></label>
<label>Create a New Password: <input type="password" pattern="[a-z0-5]{8,}" required /></label>
</fieldset>
<fieldset>
<label><input type="radio" name="account-type" /> Personal Account</label>
<label><input type="radio" name="account-type" /> Business Account</label>
<label>
<input type="checkbox" required /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
</label>
</fieldset>
--fcc-editable-region--
<fieldset>
<label>Upload a profile picture: <input type="file" /></label>
<label>Input your age (years): <input type="number" min="13" max="120" />
</label>
</fieldset>
--fcc-editable-region--
<input type="submit" value="Submit" />
</form>
</body>
</html>
body {
width: 100%;
height: 100vh;
margin: 0;
background-color: #1b1b32;
color: #f5f6f7;
}
label {
display: block;
margin: 0.5rem 0;
}