Quiz: A Field That Ignores Keys

Typing into the field should put the name on the ticket, but the field stays empty, whatever you type. Click the line with the mistake.

import { useState } from "react";

export default function App() {
    const [name, setName] = useState("");

    return (
        <main>
            <h1>Summer Sounds</h1>
            <label htmlFor="name">Name on the ticket</label>
            <input id="name" value={name} />
            <div className="ticket">
                <p className="ticket-name">{name}</p>
            </div>
        </main>
    );
}

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

Back

2/9

Next