Created
April 11, 2020 13:02
-
-
Save AirStair/62e200c7768458ab4ef95e0407ccd190 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.defineProperty(document.getElementById('test'), 'value', { | |
set: function(newValue) { | |
alert(); | |
let node = document.getElementById('test').cloneNode(true); | |
node.value = newValue; | |
document.getElementById('test').parentNode.replaceChild(node, document.getElementById('test')); | |
}, | |
}); | |
document.getElementById('test').value = 'qeqw1e' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment