I have built a script that triggers a click event on click of another element. For example, user may click element A and the script triggers a click on element B.
My issue is, that the selectors I use are specific for only one page as they contain a unique ID at the end of them, for example, on one page I may have selector-123 and on another page it may be selector-456.
Here is the actual selector
$('#accordion-section-sidebar-widgets-obox-layers-builder-4 > h3:nth-child(1)').trigger('click');
the issue is that #accordion-section-sidebar-widgets-obox-layers-builder-4
will not alway end in 4, but could end in any number.
Is there a way to use variables as my selector, something like #accordion-section-sidebar-widgets-obox-layers-builder-*