Remove IE10's “clear field” X button on certain inputs?

前端 未结 6 2327
故里飘歌
故里飘歌 2020-11-22 15:51

It\'s a useful feature, to be sure, but is there any way to disable it?
For instance, if the form is a single text field and already has a \"clear\" button beside it, it

6条回答
  •  遥遥无期
    2020-11-22 16:10

    I would apply this rule to all input fields of type text, so it doesn't need to be duplicated later:

    input[type=text]::-ms-clear { display: none; }
    

    One can even get less specific by using just:

    ::-ms-clear { display: none; }
    

    I have used the later even before adding this answer, but thought that most people would prefer to be more specific than that. Both solutions work fine.

提交回复
热议问题