PDA

View Full Version : 'Text Swap'...?


esntric
08-01-2002, 10:08 PM
I have misplaced a code example I had saved. What it did was upon the clicking of a link, replaced a portion of text on the opposite side of the page.
An example would be a page with a list of song titles on the left, and upon clicking one of these, on the right of the screen the lyrics would appear then be replaced by others when another link was selected. The lyrics are in the same HTML file, in the coding, not pulled from a seperate file.
I apologize for being so vague, just not very experienced. Any help would be much appreciated.

x_goose_x
08-01-2002, 10:28 PM
<script>
function chng(id,txt) {
document.getElementById(id).innerHTML = txt;
}
</script>

<a href="javascript: chng('lyrics','These are the lyrics.') ;">My song</a>

<div id="lyrics"></div>

esntric
08-01-2002, 10:29 PM
Thank you. :)