getElementsByClassName updated and revised
Just a small note to those of you who use my getElementsByClassName script: it has been updated for performance reasons and flexibility reasons.
One of the major differences is that tag name and containing element are optional, and if not supplied, will default to
document. This means that the order of the parameters are also changed, so
className to look for is the first one, followed by
tag and then
elm. However, for best performance, I recommend sending in all three parameters as closely specified as possible.
Nice code man! ,
IÃ‚Â´ve developed a set of somewhat similiar methods, for example:
//returns the closest parent element with tagName: strTagName
Very useful for example if you are in a td and want to get hold of the table element.
This is maybe one of the longest method names:
//returns a collection of elements with tagName: tagName, and which has an attribute with a certain value
It always interesting to have the best utility functions available. Regarding your <code>getElementsByTagAndAttributeNameAndValue</code>:
Something that might interest you then is my getElementsByAttribute.