1

I've always searching how to disable autocomplete but I haven't found exact answers.

It is usually a problem of chrome browsers that setting autocomplete="off" into the html isn't working.

How do I disable autocomplete using javascript or JQuery?

Phil
  • 157,677
  • 23
  • 242
  • 245
choopau
  • 2,209
  • 5
  • 21
  • 28

2 Answers2

2
<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        try {
            $("input[type='text']").each(function(){
                           $(this).attr("autocomplete","off");
                        });
        }
        catch (e)
        { }
    });

</script>
Robert Anderson
  • 1,246
  • 8
  • 11
0

You can try to use this workaround.

<input type="text" name="username" value=" " onclick="if(this.value == ' ') this.value=''" >

Click here for more info about this.

zavero.kris
  • 21
  • 1
  • 6