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

Differences between HTML4 and HTML5

CSS Equal Height Columns, Three Different Ways