Input caching issu

  1. after entering the account, the mobile browser will remember the password by default. The next time you enter the page again, the account password has been entered by default, but the execution code $(). Text () is empty? Then enter the same $(). Text () again in the browser console and display the normal value?
  2. my preliminary estimate is due to the cache loading order. When I executed js, the cached values had not yet been rendered into input, so I used onload ready, etc., and the results failed, so I asked for your help. How do I get the value of input.

clipboard.png
is usually correct, but when I enter a web page with a value, I can"t tell if there is a value in it, because no matter how the value is taken, it is always null.

Mar.01,2021

the value of input should be

$('input').val();

I have found a solution in Tencent Cloud. I can solve it by rewriting an event similar to change. Thank you.
$. Fn.allchange = function (callback) {

    var me = this;
    var last = "";
    var infunc = function () {
        var text = $(me).val();
        if (text != last) {
            last = text;
            callback();
        }
        setTimeout(infunc, 100);
    }
    setTimeout(infunc, 100);
};

call
$("- sharpID") .allchange (function () {code})

Menu