Categories
JavaScript Answers

How to put a clear button inside my HTML text input box like the iPhone does?

Spread the love

To put a clear button inside my HTML text input box like the iPhone does, we add a search input.

For instance, we write

<input type="search" placeholder="Search..." />

to add a search input by adding an input element with the type attribute set to search.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *