Hello,
I want the compare panel to open automatically without onClick when the compare page is loaded.
I want the class of data-element=“comparePanelToggleButton” to become class=“Button active hide-in-small-mobile”, which is class=“Button hide-in-small-mobile” in the first case.
I tried as follows, but console.log(comparePanelToggleButton) return null:
const comparePanelToggleButton = iframeDoc.querySelector(‘[data-element=“comparePanelToggleButton”]’);
console.log(comparePanelToggleButton)
if (comparePanelToggleButton) {
comparePanelToggleButton.classList.add(‘active’);
}
I tried instance.UI.openElements([ ‘comparePanelToggleButton’ ]); but it does not work.
Thanks for your support
Amir Kehtarian