i've been trying to print some message in <div id="information">
these messages were stored in the
var info
here's the
html code
- HTML: Select all
<body><div id="hello">Hello!</div>
<div id="infromation"></div>
</body>
and the
JS
- Code: Select all
var whatisthis = window.location.href.split("/");
var last= whatisthis.length -1;
var nohtml = whatisthis[last].split(".");
last = nohtml.length -2;
var info = "<h3>Title: </h3>" + "<p> Tutorial " + nohtml[last] + "</p>";
document.getElementById("information").innerHTML = document.write(info);
at the moment nothing could be printed
if i change the last line to document.write(info);
i get the message that i want though it is not printed inside the information div
How can i get those message to be printed in specific div??
thx!