Chrome ignores autocomplete=“off”

后端 未结 30 1999
礼貌的吻别
礼貌的吻别 2020-11-22 00:42

I\'ve created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89).

Despite both the

30条回答
  •  暖寄归人
    2020-11-22 01:09

    Modern Approach

    Simply make your input readonly, and on focus, remove it. This is a very simple approach and browsers will not populate readonly inputs. Therefore, this method is accepted and will never be overwritten by future browser updates.

    
    

    The next part is optional. Style your input accordingly so that it does not look like a readonly input.

    input[readonly] {
         cursor: text;
         background-color: #fff;
    }
    

    WORKING EXAMPLE

提交回复
热议问题