There's nothing worse than having placed a placeholder attribute in an input field but having it overtaken by something that looks like this:
So with this small script, I'm going to show you how to get from that, to this:
You can do it manually by adding
in each element that you want to disable it on, such as:
But that's just a pain in the ass, so here is a code that will disable it globally, but you must remember to place the script on every page where you want to disable it, or place it in a JavaScript file and include that file in every page.
It only took me 2 minutes to write so I'm not entirely fussed about credits.
So with this small script, I'm going to show you how to get from that, to this:
You can do it manually by adding
HTML:
autocomplete="off"
HTML:
<input type="text" name="username" id="username" autocomplete="off" />
But that's just a pain in the ass, so here is a code that will disable it globally, but you must remember to place the script on every page where you want to disable it, or place it in a JavaScript file and include that file in every page.
Code:
$("input[type='text'], input[type='password'], input[type='email'], input[type='url'], input[type='tel']").each(function(i,a){
$(a).attr("autocomplete", "off");
});
It only took me 2 minutes to write so I'm not entirely fussed about credits.