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.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?


Do You Yahoo!?
Send your FREE holiday greetings online!
Received on Monday, 10 December 2001 12:36:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC