getElementsByClassName - The Ultimate Version
- Created by: Robert Nyman
- Web Site: http://www.robertnyman.com
- Posted: May 23, 2008
Some ways to call it:
To get all a elements in the document with a "info-links" class:
getElementsByClassName(document, "a", "info-links");
To get all div elements within the element named "container", with a "col" class:
getElementsByClassName(document.getElementById("container"), "div", "col");
To get all elements within in the document with a "click-me" class:
getElementsByClassName(document, "*", "click-me");
Paste this source code into the designated areas.
Paste this code into the
HEAD section of your HTML document.