Find All Elements By Class

By Joe Homs on Nov 30, 2007


A function that returns an array of elements based on DOM element, tag, and class name. For instance, getElementsByClassName(document, 'tr', 'info') will return an array of all “tr” tags under the document node having the “info” class.


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: findElementsByClass.js


Paste this code into the HEAD section of your HTML document.