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
  • 128,310
  • 20
  • 201
  • 202
choopau
  • 1,662
  • 4
  • 17
  • 25

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,216
  • 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
  • 23
  • 1
  • 6