Progressive Disclosure Form
HTML
Hard
2 views
Problem Description
Create a details block that contains an optional referral code input.
Output Format
Print the HTML code.
Constraints
Use details/summary with form controls.
Official Solution
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>meetcode</title>
</head>
<body>
<form action='#' method='post'>
<label>Email <input type='email' name='email' autocomplete='email'></label>
<details>
<summary>Have a referral code?</summary>
<label>Code <input type='text' name='referral'></label>
</details>
<button type='submit'>Continue</button>
</form>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!