M
M
MrRob0t2018-03-31 20:34:01
css
MrRob0t, 2018-03-31 20:34:01

Why is the script not working. The color does not change and the header is not imported from another html file?

5abfc5579c7a5989140926.png
Please help, I'm a front-end beginner.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dymok, 2018-03-31
@MrRob0t

The script is executed before the document is loaded. To fix this, you need to wrap the script in

window.onload = function() {
  //Содержимое
}

If you are asking a question related to code - it is better to upload the code to the sandbox ( codepen.io or jsfiddle.net )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question