166
rated 0 times
[
173]
[
7]
/ answers: 1 / hits: 15522
/ 15 Years ago, thu, september 3, 2009, 12:00:00
The following div's are displayed onclick. How can I make it display a different message in the div content depending onclick. I already have the javascript to display the div's Test1 and Test2. I just wanted to add the ability to also add a message to the div content. Sorry for the confusion.
<a href= onclick=showThis('test1');return false;>Test 1</a>
<div class=test1> <p>some content</p> </div>
<a href= onclick=showThis('test2');return false;>Test 2</a>
<div class=test2> <p>some content</p> </div>
<div id=content>
<!-- if clicked on Test 1, display some message. And if clicked on Test 2, display some other message -->
</div>
More From » javascript