<input type="search" />
input[type="search"]
{
-webkit-appearance: searchfield
}
makes the clear(x) button appear when you type something in the input, but how do you make the same thing happen in Firefox?
Thanks!
<input type="search" />
input[type="search"]
{
-webkit-appearance: searchfield
}
makes the clear(x) button appear when you type something in the input, but how do you make the same thing happen in Firefox?
Thanks!
Firefox has been dragging their feet on this for years and years. Contrary to the other answer, there is still (as of late 2017) no native way of including a clear button on an input. You can of course insert your own and style it manually, in which case you'd do well to use
input[type="search"]::-webkit-search-cancel-button { display: none }
to avoid having the native clear button show up on browsers that support it.
-moz-appearance: <appearance>
Non Standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.