FormsLesson 133Free preview
Search Button
This lesson is part of How To · All levels
Summary
A search button is a button that executes a search from an input. The input and the button are usually in the same form, so pressing Enter also sends a search. For keywords, the GET method is a common choice because the results can be shared via URLs.
Key points
- Pack the input and button in the form element.
- Use the method="get" for keyword-based searches.
- The submit button will send the form when clicked or when Enter is pressed.
- Label the input and the aria-labels on the icon button.
- The name attribute on the input specifies the name of the parameter in the URL.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.