Add Remove Class to Make clicked anchor tag active Jquery

For anchor tags adding active class for selected tag and changing the styles is follows.

HTML code.

<div class="create_drive">
     <a href="#">Some Text</aui:a>
                  <a href="#">Some Text</aui:a>
</div>


Here is the script

 $(document).ready (function(){ $('.create_drive a').click(function(){ $('.create_drive a').removeClass('active'); $(this).addClass('active'); }); });

Comments

Popular posts from this blog

Gradient Border Colors with CSS

10 Useful Libraries and Resources for Responsive Web Design

The Simplest Way To Center Elements Vertically And Horizontally