That's client side stuff - you would use javascript for that. Here's a javascript function that will return an array containing the IDs of all the elements (that have IDs) in the chosen div. You'll have to enumerate them and decide which children you need to use. This means that all the items you are looking for must have IDs, of course.
function GetAllChildrenIn(parentElement) {
var children = new Array();
var numFound = 0;
try {
var obj = document.getElementById(parentElement);
var numChildren = obj.childNodes.length;
} catch (e) {
alert('Error setting vars. (' + e.Message + ')'); }
try {
for (var count = 0; count < numChildren; count++) {
if (obj.childNodes[count].id) {
children[numFound] = obj.childNodes[count].id;
numFound++;
}
}
} catch (e) { alert('Error enumerating children. (' + e.Message + ')'); }
return children;
}