#22 Only use matchesSelector for element nodes
Cleanup, check hasClass for first element in the set