+ 1
document is not declared
I have a problem when serching elements from HTML, in line var x = document.getElementById ("btn"); it says document is not declared why is this happening?
4 Answers
+ 4
window.onload = function {
//your code
}
+ 1
Try posting your whole code, but I think itâs running before the page is loaded
+ 1
How can I fix it?
+ 1
I'll try