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.
<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>
and this is html
<ul class="tabs">
<li><a href="#" id="changeText">inclusive</a></li>
<li><a href="#" id="changeText2">Hotel</a></li>
<li><a href="#" id="changeText3">Car</a></li>
<li class="end"><a href="#" 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>