Ejecutar el script después de la carga HTML

window.onload = function ...
Outstanding Oystercatcher