Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Natie Rautenbach
Added: Dec 7, 2018 9:45 AM
Views: 22
Tags: html js
  1. // when it is called straight from the click
  2. $(this).toggleClass("active").siblings().removeClass("active");
  3.  
  4. // when you are listening to the click
  5. $(".btn-group > .btn").click(function(){
  6.     $(this).addClass("active").siblings().removeClass("active");
  7. });