Try the following code
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function insertContent(sContent,id) {
document.getElementById(id).innerHTML = sContent;
return;
}
function displayTheDiv(id)
{
document.getElementById(id).style.display = "block";
return;
}
window.onload = function() {
document.getElementById('second').style.display = "none";
}
</script>
</head>
<body>
<a href="#" onclick="javascript: insertContent('This is a test','first');">Click To Insert Content</a>
<a href="#" onclick="javascript: displayTheDiv('second');">Click To Display Div</a>
<p>
<div id="first"></div>
<div id="second">Already hidden content here</div>
</p>
</body>
</html>
Bookmarks