Perché si verifica un errore nel browser?TipoErrore: document.body è null
TypeError: document.body is null
codice sta lavorando bene in JSfiddle.
HTML
<head>
<meta charset="UTF-8">
<title></title>
<script src="jsscript.js"></script>
</head>
<body>
</body>
JS
var creElem = document.createElement("p");
creElem.innerHTML = "Hellow World";
creElem.setAttribute("id", "id_name");
document.body.appendChild(creElem);
JSFiddle eseguire lo script dopo che la pagina caricata. ("onLoad" nel pannello di sinistra) – iForests