- Published on
Detect when element is ready in DOM with element-ready
- Ashik Nesin
There might be case in which we might want to detect/wait until a element is ready in the DOM before performing some operation.
For such case, element-ready might be a good choice.
npm install element-ready
import elementReady from 'element-ready'; const element = await elementReady('#example'); // it'll wait until the element #example is ready in the DOM console.log(element.id); //=> 'example'
Happy better scripting!