GaryB wrote:
Quote:
Thanks very much, Guys - used something from each of your comments.
The only thing I'm not sure of, Rob, is how to "...test if 'doc' is one
of the class names, rather than the only class name...". |
The usual trick is to test it with a regular expression, e.g. to test if
someElement's className attribute contains the class name 'someClass' as
a single word (i.e. delimited by word breaks):
var classTest = new RegExp('\\bsomeClass\\b');
if ( someEl.className && classTest.test(someEl.className))
{
/* The element's className contains someClass as a word */
}
--
Rob