Code:
function credit()
{
document.body.innerHTML+='<pre><h3>These people helped me alot:<\/h3><br><br><a href="http://www.dynamicdrive.com/forums/">Dynamic Drive<\/a><\/pre>'
}
Notice that I changed the outer delimiting quotes from double (") to single (') so that the quotes inside the string would not be seen as ending the string. I also changed innerHTML= to innerHTML+=. That should add it to the body's HTML rather than overwrite the body's HTML. But the problem with that is, if you've assigned events to elements in the body or another script has, and/or there's a form involved, things might not work as expected. Also, if the existing HTML is invalid, this very often will cause problems in at least some browsers.
It's generally better to append an element to the body, then set its innerHTML to what you want it to be. In this case you could:
Code:
function credit()
{
var pre = document.createElement('pre');
document.body.appendChild(pre);
pre.innerHTML = '<h3>These people helped me alot:<\/h3><br><br><a href="http://www.dynamicdrive.com/forums/">Dynamic Drive<\/a>';
}
Bookmarks