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
  • 141,914
  • 21
  • 225
  • 223
choopau
  • 1,931
  • 4
  • 18
  • 26

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,236
  • 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