(Sandr),
3.
<body>
<div id="parent">
<span id="son">
<div id="elem"></div>
</span>
</div>
<script type="text/javascript">
var elem = document.getElementById('elem');
var parent = elem.parentNode;
var id;
while (parent&&parent.tagName != "BODY") {
id = parent.id
parent = parent.parentNode
}
alert(id)
</script></body>