Return to Snippet

Revision: 11604
at February 11, 2009 00:29 by sarfraznawaz2005


Initial Code
// cross-browser document.getElementById, should be on top of code.
if(!document.getElementById)
{
  if(document.all)
  document.getElementById=function()
  {
	if(typeof document.all[arguments[0]]!="undefined")
	return document.all[arguments[0]]
	else
	return null
  }
  else if(document.layers)
  document.getElementById=function()
  {
	if(typeof document[arguments[0]]!="undefined")
	return document[arguments[0]]
	else
	return null
  }
}

Initial URL

                                

Initial Description
cross-browser document.getElementById, should be on top of code.

Initial Title
Truely getElementById

Initial Tags
javascript

Initial Language
JavaScript