开发者

How can I switch off "browser suggestions" via Javascript? [duplicate]

开发者 https://www.devze.com 2023-02-09 20:51 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: How do you disable browser Autocomplete on web form field / input tag?
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

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

Hello,

I have a search engine on my website with a function that shows possible results via Ajax. How can I tell the browser that it should not show the content I have searched before in a text field. So when I have a text field and someone is typing in it, there should not be the thing, that usually pops up and shows you the searches, you have allready made before. For example when typing in the search 开发者_如何学Pythonfield of Google the browser doesnt give me suggestions for what I might search. Because if that "field of suggestions" shows up, the user can not see the ajax suggestions of my website anymore.

Thanks for your help!


Well, Google's source code has "<input autocomplete=off >":

<input autocomplete="off" class=lst type=text name=q
 maxlength=2048 value="" title="Search">


document.getElementById('search').setAttribute('autocomplete', 'off');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号