var inputs = function () {
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
inputs[i].addEventListener("blur", function (e) {
});
};
};
Как можно отловить изменеие innerHTML?
<div id="div"></div>
const div = document.getElementById('div');
const mo = new MutationObserver(m => console.log(m));
mo.observe(div, { childList: true });
div.innerHTML = '<p>Привет</p>';
const div = document.createElement('div')
document.body.appendChild(div)
const divWatcher = new Proxy(div, {
set(target, prop, value) {
target[prop] = value
console.log(prop, value)
return true
}
})
divWatcher.innerHTML = 'html' // innerHTML html