Jquery how to add active class & remove class
Jquery how to add active class & remove class
HTML
<div>
<ul class="list">
<li class="active">
<a href="#"> Dashboard </a> </li>
<li> <a href="#"> Profile </a> </li>
<li>
<a href="#"> Schedule </a> </li>
</ul>
</div>
Jquery
<script>
$(document).ready(function(){
$('.list li').click(function() {
$('.list li.active').removeClass('active');
$(this).addClass('active');
});
});
</script>
Post A Comment
No comments :
Thanks For visiting Infotech Solutuion Blog