Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Substitution with the contents of a variable


Message #1 by "Peter Byers" <pb@s...> on Mon, 19 Nov 2001 06:23:22
--0-1107298849-1006166722=:83760
Content-Type: text/plain; charset=us-ascii


 I don't think if I have understood well your request. But, if you want to access an element in the DOM, why don't you use the
classical refernce to it: document.all(sID), where sID is a string identifying the element (object)?
  Peter Byers <pb@s...> wrote: Hi
If I have an object name in a variable - for example

var thisObject = "bit2_DRAG"


how can I substitute that variable for the "xxxxx" in


document.all.xxxxx.style.pixelLeft = 30;


to effectively give me the statement

document.all.bit2_DRAG.style.pixelLeft = 30;



Thank you in anticipation, I hope
Pete (Northolt UK)



---------------------------------
Do You Yahoo!?
Find the one for you at Yahoo! Personals.

  Return to Index