How to disable Chrome autocomplete feature?

后端 未结 6 1332
花落未央
花落未央 2021-02-19 07:09

We want to disable autocomplete in Chrome browser in our React JavaScript application. We have tried bunch of solution available on the Internet but nothing wor

6条回答
  •  醉梦人生
    2021-02-19 07:40

    Nothing worked for me including new-password, so this is how I did:

    onFocus={(event) => {
      event.target.setAttribute('autocomplete', 'off');
      console.log(event.target.autocomplete);
    }}
    

提交回复
热议问题