Here’s the earlier example, but with the poor-mans-jQuery added.
It’s not perfect and sometimes I add a context or something to that function if it is needed for that project, but it works fine in most cases.
As a last note, always look at the performance. If you are using selectors a lot, like in a big for-iteration, you might want to use the document.getElementsByClass function or something similar. These have less overhead and are somewhat faster.