Answers for "how to detect input value change by javascript observe"

0

how to detect input value change by javascript observe

function changeValue (event, target) {
    document.querySelector("#" + target).value = new Date().getTime();
}
 
function changeContentValue () {
    document.querySelector("#content").value = new Date().getTime();
}
 
Object.defineProperty(document.querySelector("#content"), "value", {
    set:  function (t) {
        alert('#changed content value');
        var caller = arguments.callee
            ? (arguments.callee.caller ? arguments.callee.caller : arguments.callee)
            : ''
 
        console.log('this =>', this);
        console.log('event => ', event || window.event);
        console.log('caller => ', caller);
        return this.textContent = t;
    }
});
Posted by: Guest on October-02-2021

Code answers related to "how to detect input value change by javascript observe"

Code answers related to "Javascript"

Browse Popular Code Answers by Language