# Filter FAQs by Topic

**URL:** <https://community.hubspot.com/t/filter-faqs-by-topic/38133>\
**Category:** CMS Development\
**Created:** [May 29, 2021, 1:05am UTC](https://community.hubspot.com/t/filter-faqs-by-topic/38133 "2021-05-29T01:05:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![FSantos](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fsantos/32/2679_2.png) [@FSantos](https://community.hubspot.com/u/FSantos)\
**Post date:** [May 29, 2021, 1:05am UTC](https://community.hubspot.com/t/filter-faqs-by-topic/38133/1 "2021-05-29T01:05:27Z")

</div>

I’ve created a module that will allow my client to create FAQs and organize them by topic.

 ![Screen Shot 2021-05-28 at 9.01.29 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/a/a34e35cdb999358cb766de69cd7d4ddd7a0561c1.png)

The way it’s supposed to behave is when you select a topic button, it will then filter and show only FAQs related to that topic. Currently, I’ve got it to work on a jsFiddle [here](https://jsfiddle.net/gsxvnbho/), but it’s not working on the live site [here](https://www.corridorcompany.com/-temporary-slug-da387f58-9e17-4274-9378-5a06d6ff6537?hs_preview=SyvWQfHx-48049839776). This is strange given they both have the same code.  
Any insight as to what I can do to get it to work would be appreciated.

---

<div class="post-metadata">

**Author:** ![DanielSanchez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danielsanchez/32/48193_2.png) [@DanielSanchez](https://community.hubspot.com/u/DanielSanchez)\
**Post date:** [May 29, 2021, 5:57pm UTC](https://community.hubspot.com/t/filter-faqs-by-topic/38133/2 "2021-05-29T17:57:49Z")

</div>

HI @FSantos ,

You can create a schedule of guides and each guide in your FAQ theme.

I built some FAQ modules using this code as a reference: [https://www.w3schools.com/howto/howto\_js\_tabs.asp](https://www.w3schools.com/howto/howto_js_tabs.asp)

In this page i use tabs 3 times: [https://ead.univali.br/](https://ead.univali.br/)

In this page i use tabs too: [https://ead.univali.br/bolsas-de-estudos-ead](https://ead.univali.br/bolsas-de-estudos-ead)

I hope this code can help you.

Did this post help solve your problem? If so, please mark it as a solution.

Best regards!

---

<div class="post-metadata">

**Author:** ![FSantos](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fsantos/32/2679_2.png) [@FSantos](https://community.hubspot.com/u/FSantos)\
**Post date:** [June 11, 2021, 4:49pm UTC](https://community.hubspot.com/t/filter-faqs-by-topic/38133/3 "2021-06-11T16:49:37Z")

</div>

I tried out this code purely without bringing in my custom fields and it did not work. I do think this may be a jQuery version issue because I’m getting the same console error with this other method you recomendded.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [May 31, 2021, 9:37am UTC](https://community.hubspot.com/t/filter-faqs-by-topic/38133/4 "2021-05-31T09:37:34Z")

</div>

Hi @FSantos ,

You need to include latest jquery file in hubspot backend after that code will run.  
Hope this helps!  
If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![FSantos](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fsantos/32/2679_2.png) [@FSantos](https://community.hubspot.com/u/FSantos)\
**Post date:** [June 11, 2021, 4:37pm UTC](https://community.hubspot.com/t/filter-faqs-by-topic/38133/5 "2021-06-11T16:37:34Z")

</div>

I updated the version of jquery (see below), but that did not resolve the problem.

 ![Screen Shot 2021-06-11 at 12.34.31 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/b/cbf74276c88ba1a15d131571dd98be713d1335e2.png)

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [June 11, 2021, 5:18pm UTC](https://community.hubspot.com/t/filter-faqs-by-topic/38133/6 "2021-06-11T17:18:40Z")

</div>

@FSantos

Can you try putting the function within the html panel? Curious to see if that works

```lia-code-sample
<script>
function filterSelection(c) {
 var x, i;
 x = document.getElementsByClassName("faqfullgroup");
 if (c == "all") c = "";
 // Add the "show" class (display:block) to the filtered elements, and remove the "show" class from the elements that are not selected
 for (i = 0; i < x.length; i++) {
 w3RemoveClass(x[i], "show");
 if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");
 }
}
</script>

```

---

<div class="post-metadata">

**Author:** ![FSantos](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fsantos/32/2679_2.png) [@FSantos](https://community.hubspot.com/u/FSantos)\
**Post date:** [June 11, 2021, 6:13pm UTC](https://community.hubspot.com/t/filter-faqs-by-topic/38133/7 "2021-06-11T18:13:30Z")

</div>

That worked! Thank you.
