Closed Thread Icon

Topic awaiting preservation: how to get by id Pages that link to <a href="https://ozoneasylum.com/backlink?for=8642" title="Pages that link to Topic awaiting preservation: how to get by id" rel="nofollow" >Topic awaiting preservation: how to get by id\

 
Author Thread
viol
Maniac (V) Inmate

From: Charles River
Insane since: May 2002

posted posted 05-09-2003 08:37

I am trying to change the style of a div element, so I am using this:
var x = document.getElementById("info");
in my .js file.
In the page that calls the function that has the line above, I have this:
<div class="debug" id="info">
but all I get, when the line after that line is executed, is an error, because, according to an if-else that I added for debugging purpose, the variable 'x' is null.
Why can't I get my div element using the getElementById function ?
Thanks for any help.

viol
Maniac (V) Inmate

From: Charles River
Insane since: May 2002

posted posted 05-09-2003 09:38

Forget it.
I found the problem.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 05-09-2003 13:10

Out of curiosity, would it have been possible for us to find the problem without further information (such as a link to the page)?

viol
Maniac (V) Inmate

From: Charles River
Insane since: May 2002

posted posted 05-09-2003 18:39

Certainly not.
But you know, when one is desperate, one ask silly questions.
BTW, I have posted another one, but this time, it's not silly.

« BackwardsOnwards »

Show Forum Drop Down Menu