解决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>

posted @ 2013-05-31 18:13  mguo  阅读(3728)  评论(0编辑  收藏  举报