I am looking for a simple script that will change the contents of a <div> tag on a mouseclick of a graphic. I have several graphics in a menu and they have rollover graphics that need to be displayed on mouseover. When clicked, I want to replace the text in the central part of the page.
Using a hyperlink would be easy but causes the whole page to refresh. I am looking to simply replace the div tag content to avoid the refresh. Of course, I'll probably also need to preload the content when the page first loads.
Would appreciate anyone's suggestions or a link to any reference online.
Thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<script language="javascript">
function changetext(i) {
if (i == "1") {
document.getElementById("t
} else {
document.getElementById("t
}
}
</script>
<body>
<div id="test">Test here</div>
<a href="#" onClick="changetext('1');r
</body>
</html>