Question: I'm using a Bootstrap accordion and it works like a charm, no problem at all. However, I'd like to have a link to one of the tabs in the accordion. The idea is that once I click on the link, I'm taken to that part of teh page (the accordion is really down in the page) and open the tab.

So I used the following:

```
<a href="#prizes" data-toggle="collapse" data-parent="#accordion"><i class="mdi-action-info"></i></a>

```

which should work. And it does in part: it opens the accordion tab just right, however, the page doesn't scroll to the anchor as it should. It just stays in the same position, but opening the accordion.

Any idea how to fix it? I have found answers related to jQuery UI accordion but nothing about BS accordion (and the jQuery UI answers didn't work either), really don't know why isn't this working

Answer: 
You can do it manually like so:

```
<a href="#accordion" id="my-link" class="btn btn-primary">Open group 2</a>

```

JS

```
$('#my-link').click(function(e) {
    $('#collapseOne').collapse('hide');
    $('#collapseTwo').collapse('show');        
});

```

[Fiddle](http://jsfiddle.net/tomanow/DSGxz/632/)
In order to scroll to the anchor, you should wait until your collapsable div is fully shown.

JQuery helps us to easily work out with that by collapse events. 

```
$(document).ready(function() {
    $("#section-two").on('shown.bs.collapse', function() {
        window.location = "#section-two";
    });
});

```

Check out [Bootstrap JS Collapse Reference](https://www.w3schools.com/bootstrap/bootstrap_ref_js_collapse.asp) on w3schools.com for a quick documentation.