Yes, <h7> doesn't exist, it only goes up to 6. 
And it doesn't have to be an ID. It could be any way of walking the DOM. Suppose you have this HTML:
HTML Code:
<div id="item">
<p>Some text here</p>
<p>This is a block of text with a <a href="http://example.com" class="external">link</a> in it</p>
</div>
And you want to check if the link in the second P has the class external.
Code Javascript:
var a = document.getElementById('item').getElementsByTagName('p')[1].getElementsByTagName('a')[0];
var h = has(a, 'external');
alert(h); // will alert true
Another route:
Code Javascript:
var d = document.getElementById('item');
var p1 = d.getElementsByTagName('p');
var a = p1.nextSibling.nextSibling.getElementsByTagName('a')[0];
var h = has(a, 'external');
alert(h); // will alert true
Bookmarks