var listElement = document.getElementById("element"); // could also use listElement.children; var listElements = listElement.getElementsByTagName('div'); for (i = 0; i < listElements.length; i++) { alert(listElements[i].id); }