As Adrian said, code is always good. Let's assume you already have this in the body of your document:
Code:
<body>
Text that is already there.
</body>
Then if you want to add new data to the body, you could modify it like this:
Code:
<body>
Text that is already there.
<br><div id="new_data"></div>
<a href="javascript: void(0)" onclick="document.getElementById('new_data').innerHTML='data added'; return false">add data</a>
</body>
But that's only a simple example. There are thousands of ways to add data to a file.
You are referring to 'clearing the page'. Do you have document.write in mind? That's the wrong way to do it. If you would have:
Code:
<body>
Text that is already there.
<br><div id="new_data"></div>
<a href="javascript: void(0)" onclick="document.write('data added')">add data</a>
</body>
you would clear the page before adding 'data added'.
Bookmarks