title: How to highlight the button when clicked in jquery using toggleclass?
body: <p>I've the following group of buttons and when those button or buttons is/are clicked in the group then the color of the clicked buttons must be high-lightened. How do I achieve this using toggle class or else please share me with any another approach if not toggleclass.</p>
  
  <pre><code>    &lt;div class="btn-group" data-toggle="buttons-checkbox"&gt;
                                              &lt;div class='input-group input-group-sm'&gt;
                                                  &lt;span class="input-group-addon"&gt;Week&lt;/span&gt;&lt;/div&gt;
                                              &lt;button class="btn" name="WeekButtonGroup" id="week1_sat"&gt;
                                                  S&lt;/button&gt;
                                              &lt;button class="btn" name="WeekButtonGroup" id="week1_sun"&gt;
                                                  S&lt;/button&gt;
                                              &lt;button class="btn" name="WeekButtonGroup" id="week1_mon"&gt;
                                                  M&lt;/button&gt;
                                              &lt;button class="btn" name="WeekButtonGroup" id="week1_tue"&gt;
                                                  T&lt;/button&gt;
                                              &lt;button class="btn" name="WeekButtonGroup" id="week1_wen"&gt;
                                                  W&lt;/button&gt;
                                              &lt;button class="btn" name="WeekButtonGroup" id="week1_thu"&gt;
                                                  T&lt;/button&gt;
                                              &lt;button class="btn" name="WeekButtonGroup" id="week1_fri"&gt;
                                                  F&lt;/button&gt;
                                          &lt;/div&gt;
      &lt;/div&gt;
  
  
  
  
  function highlightwhenclicked() {
   $('[name="WeekButtonGroup"]').each(function (index, element) {
  
              $(this).click(function () {
                     $(this).removeClass('active'); 
  
  
                      }
  })
  }
  </code></pre>
  
  <p>I know $(this).toggleClass can do this but how? I don't mind about what color but button must be high-lightened when clicked. Thanks in advance.</p>