Jak wyłączyć przycisk Wyczyść, który IE10 wstawia do pól tekstowych?

Jak mogę wyłączyć nową funkcjonalność w Internet Explorer 10, która pokazuje trochę " x " w polu tekstowym, gdy jest skupiony i mam w nim zawartość?

Przycisk CLEAR IE10

Author: Josh Schultz, 2012-11-21

5 answers

input[type=text]::-ms-clear {
    display: none;
}
 131
Author: Josh Schultz,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-11-20 20:29:47

In IE 10+, text input (input [type=text]) show a (X) button on the right-side on the field once you start write, it ' s used to clear/remove the entered text value.

In Chrome , search inputs (input[type=search]) show a similar button.

Jeśli wolisz usunąć któreś z nich dla IE10+ i / lub Chrome. Możesz dodać styl poniżej, aby ukryć ten przycisk przed wejściem.

Zobacz to w akcja... http://codepen.io/sutthoff/pen/jqqzJg

/* IE10+ */
::-ms-clear {
  display: none;
}

/* Chrome */
::-webkit-search-decoration,
::-webkit-search-cancel-button,
::-webkit-search-results-button,
::-webkit-search-results-decoration { 
  display: none; 
}
 15
Author: Sutthoff,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-03-10 16:05:06

This is how I did it

input[type=text]::-ms-clear
{
    display: none;
}
 2
Author: Amit Mhaske,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-05-24 07:12:28
input::-ms-clear{
   display:none;
}
To mi pomogło.
 2
Author: user5313842,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-06-11 21:43:56

Zauważ, że style i rozwiązania CSS nie działają, gdy strona działa w widoku zgodności. Zakładam, że dzieje się tak dlatego, że przycisk Wyczyść został wprowadzony po IE7, a więc Renderer IE7 używany w widoku zgodności nie widzi ::-ms-clear jako poprawnego nagłówka stylu.

 1
Author: Tom Wilson,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-08-02 21:18:52