new "getElement..." method suggestion

I'm new to this list, so I apologize if this has been discussed before.  I
did a search of the archives and did not find anything about it.

It appears that there are currently two generic methods for retrieving
elements according to their identifiers, "getElementById" and
"getElementsByTagName".  One addition that would be very useful in HTML
files is "getElementsByClassName".

I sometimes use classes to filter elements for processing by a script, and
the current methods for finding such elements are inefficient.  If elements
with different tag names might have a particular class, one must enumerate
every element and check the "className" on each.  This is further encumbered
by the fact that any particular element might have multiple classes, so the
value obtained by "className" must be parsed to see if it contains the
specific class being searched for.  A "getElementsByClassName" method would
make such script code cleaner, and user agents could hopefully return this
information much faster.

********************
Rob Cavicchio
Akonix Systems, Inc.
rcavicchio@akonix.com

Received on Friday, 27 September 2002 14:21:24 UTC