Forgive me, I'm not great at JavaScript!
I need to convert this code below (which works fine in it's own page) to work across pages in a frameset. Essentially I need the text within the the Parent frame to be changed when a link in the child frame is clicked.
I'm having trouble converting this. Any help welcome!
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
<!--
function changeCaption(textID, text) {
if(document.getElementById) {
document.getElementById(textID).innerHTML=text;
}
}
// -->
</script>
</head>
<body>
<a href="#" onclick="changeCaption('caption', 'text for image 1')" >...to this text when clicked.</a>
<span id="caption">This text changes...</span>
</body>
</html>
I need to convert this code below (which works fine in it's own page) to work across pages in a frameset. Essentially I need the text within the the Parent frame to be changed when a link in the child frame is clicked.
I'm having trouble converting this. Any help welcome!
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
<!--
function changeCaption(textID, text) {
if(document.getElementById) {
document.getElementById(textID).innerHTML=text;
}
}
// -->
</script>
</head>
<body>
<a href="#" onclick="changeCaption('caption', 'text for image 1')" >...to this text when clicked.</a>
<span id="caption">This text changes...</span>
</body>
</html>