Sometimes, we want to put a clear button inside a HTML text input box.
In this article, we’ll look at how to put a clear button inside a HTML text input box.
How to put a clear button inside a HTML text input box?
To put a clear button inside a HTML text input box, we add an input with type attribute set to search
.
For instance, we write
<input type="search" placeholder="Search..." />
to add the input with type set to search to make the clear button show on the right end of the input box.
Conclusion
To put a clear button inside a HTML text input box, we add an input with type attribute set to search
.