Non-jQuery: (was not tagged with jQuery before, so I included this)
If you want to get the first child element only:
var element = document.getElementById('PGD').children[0];
If you want to get the first anchor element:
var element;
var children = document.getElementById('PGD').children;
for(var i = 0, length = children.length; i < length; i++) {
if(children[i].nodeName == 'A') {
element = children[i];
break;
}
}
With jQuery:
var element = $('#PGD').find('a:first');
and actually your function can just be
function load(dl)
{
var element = $(dl).find('a:first');
}
Update:
As you are using jQuery, I suggest to not attach the click handler in your HTML markup. Do it the jQuery way:
$(function() {
$("#PGD").mouseover(function() {
$(this).find('a:first').attr('display','inline');
alert($(this).find('a:first').attr('display'));
});
});
and your HTML:
<div id="PGD" class="album">
<a class="dl" href="#">DOWNLOAD</a>
</div>
See for yourself: http://jsfiddle.net/GWgjB/