Some of your statements are wrong, but are not critical to your problem.
.innerHTML can be used for things other than events
and
document.write can be used before the page is displayed
so long as you don't use it again later after the page has loaded.
Code:
<html>
<head>
<script type="text/javascript">
function display() {
document.getElementById('addedText').innerHTML
= "How do I make both text appear"
+ ":<br>Like this as the 2nd sentence";
}
window.onload = function() {
display();
}
</script>
</head>
<body onload="display()">
I would like this text in the body to remain.
<div id="addedText"></div>
<script type="text/javascript">
document.write('I would like this to appear as the 3rd sentence');
</script>
</body>
</html>
Code is untested at this time, but should be close to your needs.
Bookmarks