Search the document for an element with a style name?

Posted by user246114 on Stack Overflow See other posts from Stack Overflow or by user246114
Published on 2010-06-03T16:23:24Z Indexed on 2010/06/03 16:34 UTC
Read the original article Hit count: 121

Filed under:

Hi,

Is there a way to search the DOM for an element with a particular stylename class? Something like:

var node = document.findByClassName("foo");

if so, will this be extremely slow if my page has like 2000 elements in it or so?

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript