Searching for selectors not using document.querySelector/document.querySelectorAll
Your method doesn't work because it fails to select elements outside the body.

I think what you were supposed to do is:


split the input into class / ID / tagName (using REGEX or whatever)
request elements using document.getElementByID() / document.getElementsByClassName() / document.getElementsByTagName() 
return only the elements that match all 3 requests.


Essentially, you code your own querySelectorAll function.