Code:
<span id="crumbs_section"><a href="a.com">Articles</a></span> - <span id="crumbs_category"><a href="b.com">Afghanistan</a></span> // <a href="#">Send to a friend</a>
using DOM, im trying to grab "Articles" and "Afghanistan". Here are my attempts:

- document.getElementById('crumbs_section').firstChild.nodeValue; - this gives me "null"
- document.getElementById('crumbs_section').nextSibling; - this gives me [object text]
- document.getElementById('crumbs_section').nextSibling.nodeValue; - this gives me "-"

and i get similar results when trying to grab Afghanistan. I thought that the a-tag is a child of the span tag, and im therefore confused as to why firstChild.nodeValue gives "null"?

cause of the cms im using, i cant assign an id to the a-tag, only to a tag i wrap it in. can anyone help me out? much appreciated!