How do you make a text input field in a web form?

Instruction: Illustrate how to create a basic text input field within a form.

Context: This question tests the candidate's ability to implement forms in HTML, which are crucial for capturing user input.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

Use a text input inside a form and associate a visible label with its ID:

<form action="/search" method="get"> <label for="catalog-query">Search the catalog</label> <input type="text" id="catalog-query" name="q" maxlength="100" required> <button type="submit">Search</button> </form>...

Related Questions