var imgs = document.getElementsByTagName('img'); for (var i = 0; i < imgs.length; i++) { if (imgs[i].complete) { alert('loaded'); } else { imgs[i].onload = function() { alert('loaded'); } } }