Check when the DOM is loaded like
DOMContentLoaded
Unlike DOMContentLoaded
, this also works when included after the DOM was loaded.
Install
$ npm install dom-loaded
Usage
const domLoaded = require('dom-loaded');
domLoaded.then(() => {
console.log('DOM is loaded');
});
Related
- element-ready - Detect when an element is ready in the DOM
License
MIT © Sindre Sorhus