Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Thursday, January 6th, 2005

Time Event
8:13p
This is probably basic by I have tried several things out of my book and I am getting no where

I have a DIV ID="layer1"

From a link, I am passing a variable to my function
Javascript:function("layer1");

That part is all working fine.


Where I am running into problems is:

Instead of using window.layer1.style...

I want to use the variable I passed var LayerName

to do something like window.GetElementByID(LayerName).style...

But it doesn't work.


I know I have the syntax wrong. Can someone help me out?


SOLVED document.getElementById()
Document, not window. Corrected capitalization (mistyped it here).

<< Previous Day 2005/01/06
[Calendar]
Next Day >>
About LiveJournal.com
Image