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
.