Hello all,
I have a page where the user clicks a link, one of several, and some text is displayed.
The code I have does exactly that.
My question is how do I show only the the current text inside the div container ?
I've had a look at clearing innerHTML and div's. I just cannot seem to implement this.
Help appreciated.
Regards.
<script text/javascript>
function ChangeOne() {
document.getElementById("text1").innerHTML = '<p>Text 1</p>';
}
function ChangeTwo() {
document.getElementById("text2").innerHTML = '<p>Text 2</p>';
}
...
</script>
<div id="content">
<div id="text1"></div>
<div id="text2"> </div>
...
</div>
<a href="#" onclick="ChangeOne();">Link to text 1</a><br />
<a href="#" onclick="ChangeTwo();">Link to text 2</a><br />
...