const path = window.location.pathname;
const parts = path.split('/');
const secondWord = parts[2]; // "scaffolding-systems"
// Select all elements within the element with the class "sidebar-accor"
const detailsElements = document.querySelectorAll('.sidebar-accor details');
// Loop through each element
detailsElements.forEach(details => {
// Check if the "id" attribute matches the secondWord
details.removeAttribute(open)
if (details.id === secondWord) {
// Perform your desired action, e.g., log to the console or open the element
details.setAttribute('open', true);
}
});
const path = window.location.pathname;
const parts = path.split('/');
const secondWord = parts[2]; // "scaffolding-systems"
// Select all elements within the element with the class "sidebar-accor"
const detailsElements = document.querySelectorAll('.sidebar-accor details');
// Loop through each element
detailsElements.forEach(details => {
// Check if the "id" attribute matches the secondWord
details.removeAttribute(open)
if (details.id === secondWord) {
// Perform your desired action, e.g., log to the console or open the element
details.setAttribute('open', true);
}
});