<div id="test">
<a href="rabout.php"></a>
<div id="aa">
<a href="aabout.php"></a>
</div>
<a href=""></a>
</div>
<script>
var links = document.querySelectorAll("a[href*='about.php']");
for (var i = 0; i < links.length; i += 1) {
alert(links[i].parentNode.id);
}
</script>
или
<div id="test">
<a href="rabout.php"></a>
<div id="aa">
<a href="aabout.php"></a>
</div>
<a href=""></a>
</div>
<script>
var links = document.links;
for (var i = 0; i < links.length; i += 1) {
var link = links[i];
if (link.href.indexOf('about.php') !== -1) {
alert(link.parentNode.id);
}
}
</script>
еще парочку решений