Jump to content

[SOLVED] getElementById in external files?


Guardian-Mage

Recommended Posts

Post your code - getElementById works fine in external functions, so its likely that your problem lies somewhere else. Show us the javascript in question, as well as the tag which you are trying to access.

 

Finally, don't use body-onload. This isn't recommended anymore. Add this to the bottom of your external js file:

 

window.onload = function()
{
     // in here place the code you want executed when the page loads
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.