解决chrome input 黄色背景色的问题

不需要关闭autocomplete的情况下通过js完美解决.

<script>
 
  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);
    });
  });
}
</script>

原文地址:https://www.cnblogs.com/mguo/p/3110889.html