W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2001

access to elements w/o initial reference?

From: alex <shortestpath@yahoo.com>
Date: Mon, 10 Dec 2001 08:38:25 -0800 (PST)
Message-ID: <20011210163825.30861.qmail@web14509.mail.yahoo.com>
To: www-dom@w3.org
I hope I'm asking the question correctly: 
Does an element you create stay in memory for later
access, even though you don't have (or don't save)
a reference to it when you create it?

I have a javascript function in which I use a loop
to create some html select elements:

function createSelects() {
  var i = 0;
  while (i < [some condition]) {
    document.createElement("select");
    document.setAttribute("id", new String("mySelect" + i));
    ...
  }
}

I'd like to be able to get to the selects (using 
document.getElementById I guess), however many there 
may be, from a different function later on. Is this 
possible? If so can someone show me how?

Thanks!
-alex

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
Received on Monday, 10 December 2001 12:36:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:55 GMT