Geeks With Blogs

Tim Huffam Dotting the I and crossing the T of I.T.

To obtain an object or a 'all' collection of child objects somewhere in the DOM you can use something like this:

  var all, myObj;
  if (document.all) {    // IE;
    all = document.all["myParentObj"].all;
    myObj=document.all["myFormElement"];
  }
  else{
    if(document.getElementById("myParentObj") && document.getElementById("myFormElement")){
      all = document.getElementById("myParentObj").getElementsByTagName("*");
      myObj=document.getElementById("myFormElement");
    }
    else
      alert("Error: This application does not support your browser.  Try again using IE or Firefox.");
  }

HTH

Tim

Posted on Wednesday, January 18, 2006 11:43 AM ASP.NET , PHP (incl PhpMyAdmin) , Web Development, JavaScript & CSS | Back to top


Comments on this post: IE and Firefox compatible javascript to reference a single object or a collection of child objects in the DOM

# re: IE and Firefox compatible javascript to reference a single object or a collection of child objects in the DOM
Requesting Gravatar...
thanks,
this is help me :)
Left by Shadi on Mar 26, 2008 2:18 AM

# re: IE and Firefox compatible javascript to reference a single object or a collection of child objects in the DOM
Requesting Gravatar...
Once again, a random Google search turns up this site, and it solves my problem. I'm terrible at writing js and this saved me a bunch of time.

If there's a contest for "most helpful tech websites" I'll nominate this one :)
Left by UK Dating Site Reviews on Feb 24, 2011 7:02 PM

Your comment:
 (will show your gravatar)


Copyright © Tim Huffam | Powered by: GeeksWithBlogs.net