Skip to content

Instantly share code, notes, and snippets.

@hotmeteor
Forked from reinink/gist:1683466
Created January 26, 2012 16:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotmeteor/1683734 to your computer and use it in GitHub Desktop.
Save hotmeteor/1683734 to your computer and use it in GitHub Desktop.
Remove yellow background caused by Google Chrome autocomplete
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0)
{
$(window).load(function()
{
$('input:-webkit-autofill').each(function()
{
var text = $(this).val();
var name = $(this).attr('name');
$(this).after(this.outerHTML).remove();
$('input[name=' + name + ']').val(text);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment