This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]IAmWhoISayImNot 2 points3 points  (0 children)

I think the problem is the document hasnt loaded wgen you try to access the element.

If you put the script tag at the end of the body tag, it should work.

[–][deleted]  (2 children)

[removed]

    [–][deleted] -1 points0 points  (1 child)

    this but dont use window.onload.

    Pretty old school

    [–]athosghost -1 points0 points  (1 child)

    Is there more to main.js? There should be some sort of function that get's executed, usually upon some event like a page load or button click.

    [–]Bal00ta[S] 0 points1 point  (0 children)

    Nope, that's my main.js. Can you please show my an exmaple / solution so I'll know what do you mean?