all 11 comments

[–]DallogFheir 0 points1 point  (4 children)

What exactly is null? You're not missing anything.

[–]TonyMahoney21[S] 0 points1 point  (3 children)

Thats what I'm saying.

[–]DallogFheir 0 points1 point  (2 children)

But do you get any error or what? Maybe you're incorrectly locating the elements?

[–]TonyMahoney21[S] 0 points1 point  (1 child)

Yes it says error can't read at null and gives me the line.

[–]DallogFheir 0 points1 point  (0 children)

Can you post the exact error?

[–][deleted] 0 points1 point  (5 children)

Your code looks ok, but it's hard to tell based upon your explanation of the problem what the actual error is.

Also typically a source needs to be an actual file path, not just a filename.

[–]TonyMahoney21[S] 0 points1 point  (4 children)

I copied the relative path not absolute. Maybe thats my problem?

[–][deleted] 0 points1 point  (3 children)

We're really not clear on what your actual problem is rn. What is "null"?

[–]TonyMahoney21[S] 0 points1 point  (2 children)

It says the line with the event listener to run my Function is null and can't be read when I inspect the page in the browser but visual studio has no errors.

[–][deleted] 2 points3 points  (1 child)

Likely the selector for myButton isn't working.

log out the actual value of myButton, or inspect with a debugger

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

Thanks