<li id="feed_1">
<a id="feed_1_1" href="">
</li>
var feed_1 = document.getElementById('feed_1');
if (feed_1)
{
alert(feed_1.firstChild.id);
}
<li id="feed_1">
<a id="feed_1_1" href="">
</li>
var feed_1 = document.getElementById('feed_1');
if (feed_1)
{
alert(feed_1.firstChild.id);
}
The firstChild will be a newline character. One way to get the first HTML child element would be:
alert( feed_1.getElementsByTagName( '*' )[ 0 ] );
Also avoid global variable names that clash with IDs