In chrome, when I type in a search field, there appears a cross which clears the field when clicked (one can also use Esc for this).
<input type="search">
Is there any way to hide this cross?
EDIT:
If you use attribute results="2"
, it starts showing a magnifying glass too. what kind of sorcery is this? Why does the glass shows up when I use the results
attribute?
<input type="search" results="2">
Sourabh you will need to disable WebKit’s proprietary pseudo elements
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
display: none;
}
Let me know if this helps
For your case use:
input[type="search"]::-webkit-search-cancel-button {
display: none;
}
input[type="search"]::-webkit-search-cancel-button {
display: none;
}
<input type="search">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With