I have a filter on one page. When the user enters this page, if they have an ID I want this filter to trigger that ID.

For example, if the id = event, I want the event filter to trigger.

Is there a more fluid way to display this, rather then showing each individual id?

For example, this is working below:-

```
    if ( document.location.href.indexOf('#events') > -1 ) {
        $(".btn.events").trigger('click'); 
    }
    if ( document.location.href.indexOf('#video') > -1 ) {
        $(".btn.video").trigger('click'); 
    }

```

But it would work much better if this was fluid. I really need to say if the URL has an ID, then find the button with the same class and the trigger this event.

Thank you