Looking for some help with a tricky problem I've encountered.
I have created a script that identifies labels with a 'selected' class on their parent element, clones them, and appends them to an active list to create a 'Filtered Items' list.
My goal is to include the title of each section that the label belongs to in the text of the label itself. For example, if a label is selected from the 'Size' section, I want it to read 'Size: S', and if it's from the 'Color' section, it should show 'Color: Blue'. Currently, I am able to retrieve all the titles but struggling to filter it down to the correct section.