Snippets v2

Languages
My Snippets

getElementById Cross Browser Login or Register to Bookmark this snippet

Description Javascript

xGetElementById is a cross-browser version of document.getElementById

The Code Download
  1. function xGetElementById(e) {
  2.     if(typeof(e)!='string') return e;
  3.     if(document.getElementById) e=document.getElementById(e);
  4.     else if(document.all) e=document.all[e];
  5.     else e=null;
  6.     return e;
  7. }
Credits Contact JC

Added by JC on 11th November, 2007

Comments

There are no comments about this snippet.

Post Comment HTML is allowed

You must be registered and logged in to post a comment.

Login here to post a comment