checking existence of an element?

Giganews Newsgroups
Subject: checking existence of an element?
Posted by:  The Plankmeister (plankmeister_NOSPA…@hotmail.com)
Date: Wed, 10 Sep 2003

Is it possible to check for the existence of an element? I have a dynamic
page which may or may not have a <div> holding a bunch of thumbnails, and I
want a function to check for the existence of the <div>. Doing:

blah = getElementById("thumbnails");

Generates an error.... I was hoping it would just return false or
something... Is there a way of doing this?

P.

Replies