Search code examples
javascriptformsinputautosuggest

Prevent field from suggesting previously used word in JavaScript


Possible Duplicate:
How do you disable browser Autocomplete on web form field / input tag?

I have a doubt about running a script in JavaScript.

Let's say that I entered in a form "Hello World". Days latter I come back to the same form using the same machine and I'm going to type "Hello World" again, but when I type "H", the word "Hello World" pops up already.

I don't remember setting anything in my script to have that functionality. I searched through it all but I don't see anything that may be causing that behavior.

What do I have to remove to make it stop?


Solution

  • That's autocomplete.

    It comes by default, you don't have exactly to "remove it" but to turn it off.

    It'll be something like this:

    <input ... autocomplete="off">