I know this can be done with (1) ajax and also (2) hide/show div’s.
I have three links and I want to update the text inside a div when each link is clicked. I thought I was doing this right…
<script type="text/javascript" src="include/jquery-ui-1.8/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(function() {
// default text
$("#welcomebox").text("Welcome!");
// text if first link is clicked
$("#cs1").click(function (){
$("#welcomebox").text("Test 1");
});
// text if second link is clicked
$("#cs2").click(function (){
$("#welcomebox").text("Test 2");
});
// text if third link is clicked
$("#cs3").click(function (){
$("#welcomebox").text("Test 3");
});
});
</script>
<a id="#cs1">One</a> | <a id="#cs2">Two</a> | <a id="#cs3">Three</a>
<div id="welcomebox" style="width: 400px;"></div>