Is there a W3C valid way to disable autocomplete in a HTML form?

后端 未结 18 1427
心在旅途
心在旅途 2020-11-22 05:58

When using the xhtml1-transitional.dtd doctype, collecting a credit card number with the following HTML



        
18条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 06:15

    If you use jQuery, you can do something like that :

    $(document).ready(function(){$("input.autocompleteOff").attr("autocomplete","off");});
    

    and use the autocompleteOff class where you want :

    
    

    If you want ALL your input to be autocomplete=off, you can simply use that :

    $(document).ready(function(){$("input").attr("autocomplete","off");});
    

提交回复
热议问题