Disable Chrome Autofill & Autocomplete With jQuery - disableAutoFill

File Size: 46.9 KB
Views Total: 30415
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Disable Chrome Autofill & Autocomplete With jQuery - disableAutoFill

disableAutoFill is a lightweight jQuery/Vanilla JS plugin for disabling autofill and autocomplete functionalities in the Google Chrome browser.

How it works:

  • Add autocomplete="off" attribute on your form.
  • Add random chars on "name" attribute to avid Browser remember what you submitted before.

How to use it:

1. Insert the minified version of the disableAutoFill plugin into the HTML document.

<!-- As A Vanilla JS Plugin -->
<script src="/path/to/dist/disableautofill.min.js"></script>
<!-- As A jQuery Plugin -->
<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/dist/jquery.disableautofill.min.js"></script>

2. Call the function disableAutoFill() on the html form.

<form id="demo">
// As A Vanilla JS Plugin
var daf = new disableautofill({
    'form': '#demo',

// As A jQuery Plugin

3. Determine the form fields on which you'd like to disable the autocomplete functionality. The plugin automatically replaces type="password" with type="text" as well as replacing the text of password with asterisk symbols.

  'fields': ['.new-pass', '.confirm-pass'],
  'asterisk': '●'

4. Validate the form using the callback option.

  'callback': function() {
    // do something

5. Enable & disable the debug mode.

  'debug': true


v2.0.0 (2021-02-21)

  • Refactor
  • Added Vanilla JS version

v1.2.8 (2019-04-04)

  • Fix asterisk in password problem and add hiding character parameter
  • Add support to multiple passwords fields


  • Supports multiple password fields.


  • Fixed: radio button


  • Fixed: "realPassword" array goes out of sync if user backspaces / deletes / overwrites


  • Fixed issues with passwordField


  • v1.2.4: Fixed HTML5 form validation


  • Bugfix


  • Fix mutli form submit button issue

This awesome jQuery plugin is developed by terrylinooo. For more Advanced Usages, please check the demo page or visit the official website.