I create the menu :
<ul id="menu">
<li>
<a href="#" onclick="load(1);return false;"> Team Install</a>
</li>
<li>
<a href="#" onclick="load(2);return false;"> PC and Laptop Service</a>
</li>
<li>
<a href="#" onclick="load(3);return false;"> Web Design and Internet Services</a>
</li>
<li>
<a href="#" onclick="load(4);return false;"> Software and Database Dev.</a>
</li>
</ul>
<div id="LoadMe"></div>
And this is what I do in jquery:
<script type="text/javascript">
$(document).ready(function () {
$("#LoadMe").load('/Service2.html');
$('#menu a[href="' + url + '"]').addClass('selectedcategoryServices');
});
function load(num) {
$("#LoadMe").load('/Service' + num + '.html');
}
</script>
But the menu doesn’t have the selectedcategoryServices when I clicked it ready, could any one tell me how can I do this?
Try it this way
check this demo