Tag Archives: Uncaught TypeError: Cannot read property ‘appendChild’ of null ?

Uncaught typeerror: cannot read property ‘appendChild’ of null? report errors

Generally, it is because the obtained node does not exist

The reasons may be as follows:

When you get this node, it is not loaded. For example, write JS code in & lt; head> Inside, you get the node of the body, which you can’t get at this time. Put JS code in & lt; body> You can get it later