Find All Elements By Class | JavaScriptSource

Find All Elements By Class

Joe Homs 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.

Leave a Response