I want to fire and event when the DOM has completely loaded. I checked out document.readyState but it’s not an event. I want to fire it when the readyState is complete. How do I do that?
I want to fire and event when the DOM has completely loaded. I checked
Share
For anyone already using the jQuery library the ready function can be used to handle this.
Otherwise the solution from @Neal will achieve the same functionality without needing to add an additional dependency.