//document.getElementByClass is not what you are looking for but: document.getElementsByClassName(your_class);