You can use the DOMContentLoaded event.
document.addEventListener('DOMContentLoaded', function() {
// ...
});
Note that in older IEs you need workarounds, some use the readystatechange event if I recall correctly.
You can use the DOMContentLoaded event.
document.addEventListener('DOMContentLoaded', function() {
// ...
});
Note that in older IEs you need workarounds, some use the readystatechange event if I recall correctly.