add/change class accordion element on the next page when click on a link

74 Views Asked by At

Let me explain what i mean because its hard to explain it in the title. On my homepage i got 3 links to my contact page,

  • let us call u back
  • send us and email
  • make an appointment

on my contact page i got those 3 elements in a bootstrap accordion element. when u click on 1 it opens and shows a form, its adds the class 'in' to the element.

Now i want: when i click on one of those 3 links on my homepage, it adds the class 'in' to the selected element so that accordion element is open.

Anyone knows if this is possible and how to do this?

1

There are 1 best solutions below

0
On BEST ANSWER

For people with the same question/problem/issue.

I used this question for my issue.

jQuery add class based on page URL,

just adding the 'in' class depending on the URL