jquery - Bootstrap Left Navigation Menu with active class and border -


i want add active class on left menu when clicks on it. tried following if add e.preventdefault() link doesn't work , doesn't show output. if remove e.preventdefault() gives me output active class goes home. , add border in left menu . if have solution, let me know . here code

html file code

<ul class="nav nav-pills nav-stacked span2" >         <li class="active"><a href="home.aspx">home</a></li>         <li><a href="shreddingstatistics.aspx">shredding statistics report</a></li>         <li><a href="shreddingdetailreport.aspx">shredding detail report</a></li>  </ul> 

jquery code

    $(document).ready(function () {          $(".nav.nav-pills.nav-stacked li").click(function (e) {                         e.preventdefault();                         $(".nav.nav-pills.nav-stacked li").removeclass("active");                         $(this).addclass("active");                      }); }); 


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -