How to add a clear icon inside input text with HTML?

Spread the love

Sometimes, we want to add a clear icon inside input text with HTML.

In this article, we’ll look at how to add a clear icon inside input text with HTML.

How to add a clear icon inside input text with HTML?

To add a clear icon inside input text with HTML, we set the input’s type to search.

For instance, we write

<input type="search" />

to set the type attribute to search to make the browser show the search icon in the input.

Conclusion

To add a clear icon inside input text with HTML, we set the input’s type to search.

Leave a Reply

Your email address will not be published.