How to disable autofill/autocomplete for input fields

I have read a lot of tutorials about how to disable autofill/autocomplete for input fields in the html forms but i never found a solution to solve this problem. In this tutorial I want present you my own solution to disable autofill/autocomplete for input fields in all browsers. My solution is very simple and I'm using jQuery.

If you have a login page: username and password or email and password, just copy the id or class of your username or email field and add it in a jQuery code:

jQuery(".username or .email").val(' ');
setTimeout(function(){jQuery(".username or email").val('');},100);

In this way you will disable autofill/autocomplete for input fields in your login page.

I have created also a video where you can see how works my solution:









Leave a Comment