Detecting getElementByID?

pmj7's picture

He has: 234 posts

Joined: Nov 2002

As recommended, I'm checking for getElementByID before using it. It doesn't seem to work though.

if (document.getElementByID)
document.write('Supported');
else
document.write('Not Supported');

This reports back 'Not Supported', yet when I actually use the getElementByID call it works just fine.

Peter

Touchup image processing applet
Pixel Development Web Design, Photography

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

getElementById is case-sensitive. Try changing the D to d. Wink

pmj7's picture

He has: 234 posts

Joined: Nov 2002

Thanks!

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Always the little things, huh?

You're welcome. Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.