title: How to keep focus on Boostrap accordion
body: <p>I have this accordion and I want the whole row to be clickable but when I click it focus is set back to the top of the application. I am using the  tag along with the  so that when a keyboard is used on a mobile device it will get focus. Is there a way to get focus to stay on row and not go to the top?</p>
  
  <pre><code>    &lt;div id="accordion" class="panel-group"&gt;
          &lt;div class="panel panel-default"&gt;
              &lt;div class="panel-heading" data-target="#content1"&gt;                 
                  &lt;h2 class="panel-title" title="hidden content closed"&gt;
                      &lt;a href="#content1"&gt;
                          &lt;span aria-hidden="true"&gt;Milky Way Black Hole Belches&lt;/span&gt;
                          &lt;span class="glyphicon glyphicon-chevron-down pull-right"&gt;&lt;/span&gt;
                      &lt;/a&gt;
                  &lt;/h2&gt;
  
              &lt;/div&gt;
              &lt;div id="content1" class="panel-collapse collapse"&gt;
                  &lt;div class="panel-body"&gt;
                      The monster back hole at the center of the Milky Way belched out an exceptionally high number of powerful X-ray flares in August 2014, did the beast chow down on a passing gas cloud, or is this typical for black holes? &lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="panel panel-default"&gt;
              &lt;div class="panel-heading"  data-target="#content2"&gt;
  
                  &lt;h2 class="panel-title" title="hidden content Closed"   &gt;
                      &lt;a href="#content2"&gt;
                          &lt;span aria-hidden="true"&gt;Tiny Pluto Moon Kerberos Unveiled&lt;/span&gt;
                          &lt;span class="glyphicon glyphicon-chevron-down pull-right"&gt;&lt;/span&gt;
                      &lt;/a&gt;
                  &lt;/h2&gt;
  
              &lt;/div&gt;
              &lt;div id="content2" class="panel-collapse collapse"&gt;
                  &lt;div class="panel-body"&gt;
                      Newly received photos captured by NASA's New Horizons spacecraft reveal that Pluto's tiny moon Kerberos is smaller and brighter than researchers had expected. 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="panel panel-default"&gt;
              &lt;div class="panel-heading"  data-target="#content3"&gt;
                  &lt;h2 class="panel-title" title="hidden content Closed"&gt;
                      &lt;a href="#content3"&gt;
                          &lt;span aria-hidden="true"&gt;New Horizons Pluto Probe Heads Toward 2nd Flyby Target&lt;/span&gt;
                          &lt;span class="glyphicon glyphicon-chevron-down pull-right"&gt;&lt;/span&gt;
                      &lt;/a&gt;
                  &lt;/h2&gt;
  
              &lt;/div&gt;
              &lt;div id="content3" class="panel-collapse collapse"&gt;
                  &lt;div class="panel-body"&gt;
                      New Horizons, which in July performed the first-ever flyby of Pluto, fired up its engines yesterday (Oct. 22) in the first of four maneuvers designed to send the probe zooming past a small object called 2014 MU69 on Jan. 1, 2019. &lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="panel panel-default"&gt;
              &lt;div class="panel-heading"  data-target="#content4"&gt;
  
                  &lt;h2 class="panel-title" title="hidden content Closed"&gt;
                      &lt;a href="#content4"&gt;
                          &lt;span aria-hidden="true"&gt;Ingredients for Life Were Always Present on Earth, Comet Suggests &lt;/span&gt;
                          &lt;span class="glyphicon glyphicon-chevron-down pull-right"&gt;&lt;/span&gt;
                      &lt;/a&gt;
                  &lt;/h2&gt;
  
              &lt;/div&gt;
              &lt;div id="content4" class="panel-collapse collapse"&gt;
                  &lt;div class="panel-body"&gt;
                      Astronomers detected 21 different complex organic molecules streaming from Comet Lovejoy during its highly anticipated close approach to the sun this past January. Many of these same compounds have also been spotted around newly forming stars
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>JavaScript</p>
  
  <pre><code>    &lt;script&gt;
      $(document).ready(function() {
          $('.panel-heading').click(function(){
              var target = $(this).data("target");
              $('#accordion').on('show.bs.collapse', function () {
                  $('#accordion .in').collapse('hide')
                  $(this).attr('title', 'hidden content closed');
              });
              $(target).collapse('toggle')
              $(this).attr('title', 'hidden content open');
          });             
      });
  
      $('.collapse').on('shown.bs.collapse', function(){
          $(this).parent().find(".glyphicon-chevron-down").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up");
          }).on('hidden.bs.collapse', function(){
          $(this).parent().find(".glyphicon-chevron-up").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down");
      });
  
      $(".collapse").on('hide.bs.collapse', function(){
          var title = $(this).parents('div.panel').find('.panel-title')[0];
          var titleText = $(title).text();
          $(title).attr('title',titleText+' hidden content closed');
      });
  
      $(".collapse").on('show.bs.collapse', function(){
         var title = $(this).parents('div.panel').find('.panel-title')[0];
         var titleText = $(title).text();
         $(title).attr('title',titleText+' hidden content open');
      });
  
  &lt;/script&gt;
  
  &lt;!-- Add text to open\close menu button --&gt;
  &lt;script&gt;
      $('.navbar-collapse').on('shown.bs.collapse', function() {
            $(this).parent().find(".navbar-toggle").attr('title', 'dropdown menu open');
          }).on('hidden.bs.collapse', function() {
            $(this).parent().find(".navbar-toggle").attr('title', 'dropdown menu closed');
          });
  &lt;/script&gt;
  </code></pre>