You could use .querySelectorAll()
:
https://developer.mozilla.org/en-US/docs/Web/API/Document.querySelectorAll http://caniuse.com/queryselector
like so:
var names = document.querySelectorAll('li h2');
which would return a NodeList (https://developer.mozilla.org/en-US/docs/Web/API/NodeList) containing all elements matching the CSS selector: li h2
.
Or, if you're just looking for a single element, you could just use .querySelector() which would return a reference to the first element matching your selector.