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

CSS Equal Height Columns, Three Different Ways

The Simplest Way To Center Elements Vertically And Horizontally

User Avatar Image and User name and Email in LIferay Theme