<script>
// On the page with outbound links
window.Webflow ||= [];
window.Webflow.push(() => {
const links = document.querySelectorAll(".link");
console.log(links);
links.forEach((link, index) => {
link.href += `?tabNumber=${index}#faqs`; // #faqs is section id
});
});
</script>
<script>
// On the page with your CMS Collection
window.Webflow ||= [];
window.Webflow.push(() => {
let url = new URL(window.location);
let tabNumber = url.searchParams.get("tabNumber");
let questionElements = document.querySelectorAll(".faq1_question");
if (!tabNumber || !questionElements) {
return;
}
questionElements[tabNumber].click();
});
</script>