How to tell JavaScript to execute a function after an element has been loaded w/out any external library?
Normally I have to bring the <script>
tag after the element itself to work with DOM calls.
Advertisement
Answer
Well you can utilize the document.onload
and window.onload
methods
For example:
window.onload = function(){ //do some stuff }