The method returns a list of elements with the given tag name. Here is a compact crossbrowser implementation that will reduce your code immensely.