I have an element (let\'s say div with id \"Test\") with a set height and width. Randomly placed within this element are other (smaller) elements (let\'s say id\'s \"inner1\
Add an onClick handler to your Test div and use event bubbling to trap clicks on the inner elements. You can extract the clicked element from the event object.
document.getElementById("Test").onclick = function(e) {
e = e || event
var target = e.target || e.srcElement
// variable target has your clicked element
innerId = target.id;
// do your stuff here.
alert("Clicked!");
}