How to clear previous text in the div?

brissbill

New Member
using this script i can change the text in a div on click other text..i have four different text and a Div i want to change the text in div by clicking on other four text, its working properly but the problem is that i also show previous text when i click on next link, i want to clear previous text and show only new text..Please find the attach script and HTML and then help me , and let me know for further question.\[code\]<script type="text/javascript"> $(document).ready(function() { $("#changeText1").click(function() { $("#textBox1").html("My text is changed1!"); }); });</script><script type="text/javascript"> $(document).ready(function() { $("#changeText").click(function() { $("#textBox").html("My text is changed!"); }); });</script><script type="text/javascript"> $(document).ready(function() { $("#changeText2").click(function() { $("#textBox2").html("My text is changed!2"); }); });</script><script type="text/javascript"> $(document).ready(function() { $("#changeText3").click(function() { $("#textBox3").html("My text is changed!3"); }); });</script><script type="text/javascript"> $(document).ready(function() { $("#changeText5").click(function() { $("#textBox5").html("My text is changed5!"); }); });</script>\[/code\]and this is html\[code\]<ul class="tabs"> <li><a href="http://stackoverflow.com/questions/15597152/#" id="changeText">inclusive</a></li> <li><a href="http://stackoverflow.com/questions/15597152/#" id="changeText2">Hotel</a></li> <li><a href="http://stackoverflow.com/questions/15597152/#" id="changeText3">Car</a></li> <li class="end"><a href="http://stackoverflow.com/questions/15597152/#" id="changeText5">Cruise</a></li></ul><div class="tabs_cont"> <div id="textBox3" style="color:#FFF"></div> <div id="textBox" style="color:#FFF"></div> <div id="textBox1" style="color:#FFF"></div> <div id="textBox2" style="color:#FFF"></div> <div id="textBox5" style="color:#FFF"></div></div><div id="textBox4" style="color:#FFF"></div>\[/code\]
 
Back
Top