Created
January 26, 2012 15:58
-
-
Save reinink/1683466 to your computer and use it in GitHub Desktop.
Remove yellow background caused by Google Chrome autocomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) | |
{ | |
$(window).load(function() | |
{ | |
setTimeout(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); | |
}); | |
}, 50); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@reinink Nice script. Got it working but replaced:$(this).after(this.outerHTML).remove(); with: $ (this).after(this.outerHTML).before().addClass('remove');
Works perfectly. Thanks bro!