Chrome Autofill/Autocomplete no value for password

后端 未结 20 1891
逝去的感伤
逝去的感伤 2020-11-27 02:57

When you have saved username and password for some site Chrome will autofill that username and password, but if you try to get the value for the password input field it is e

20条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 03:09

    I tried all the solutions and wasn't working for me so i came up with this. My problem is i have an input that move the placeholder top when it is filled, off course this is not working when Chrome autofill it. Only tested in Chrome :

     setTimeout(function () {
         var autofilled = document.querySelectorAll('input:-webkit-autofill');
             for (var i = 0; i < autofilled.length; i++) {
                 Do something with your input autofilled
             }
     }, 200);
    

提交回复
热议问题