YAD <go******@vapornet.comwrote in
news:eb**********@wildfire.prairienet.org:
How do you make a small change to the body of an html page from an event
handler? If you have a string var, a function that displays it in the
body, and a function that changes it, can you change the var on an event
and then reparse the body of the page but not the head? And if not,
then what?
I'm a JavaScript novice, but how about something like this:
<html><head>
<title>Ch-ch-changes...</title>
<script type="text/javascript" language="javascript"><!--
function showThisText(text)
{
// santity checks left out for clarity...
target = document.getElementById('changeTarget');
// you may also want to do something less brute-force here, too
target.innerHTML = text;
}
--></script>
</head><body>
<div onMouseOver="showThisText('I\'ve been changed!')"
onMouseOut="showThisText('original text')">Mouse over me!</div>
<p>
<div id="changeTarget">original text</div>
</body></html>