JSFiddle - React, Tailwind, and code Playground
by Alex Alex
HTML
<input type=file>
JavaScript
// select the target node
var target = document.querySelector('[type="file"]');
// create an observer instance
var observer = new MutationObserver(function(mutations) {
console.log(mutations);
});
// configuration of the observer:
var config = { attributes: true, childList: true, characterData: true };
// pass in the target node, as well as the observer options
observer.observe(target, config);