var imgs = document.getElementById('dragObjects1').getElementsByTagName('img'), imgsInd = -1; while (imgs[++imgsInd]) { dragMaster.makeDraggable(imgs[imgsInd]); }