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

后端 未结 18 1570
心在旅途
心在旅途 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:30

    This solution works with me:

    $('form,input,select,textarea').attr("autocomplete", "nope");
    

    if you want use autofill in this region: add autocomplete="false" in element ex:

    
    

提交回复
热议问题