Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Data Element for Subclass

Avatar

Level 1

Hi there, 

I'm trying to capture the subclass of a html on a row of icons. What would the appropriate DOM attribute be to capture the value in bold red (def) when clicked?

div.buttons.mt-4.mx-auto.abc > div > div.abc.def

div.buttons.mt-4.mx-auto.abc > div > div.abc.ghi

div.buttons.mt-4.mx-auto.abc > div > div.abc.jkl

I've tried doing this previously, and I've managed two outcomes:

1) Captured only the parent class (abc)

2) Successfully capturing both class (abc def) but only the first value (abc def) even though I've clicked the subsequent icons (abc ghi / abc jkl) 

Are there any suggestions on how I can successful tag the buttons either with Launch settings or custom code? Appreciated!

1 Accepted Solution

Avatar

Correct answer by
Level 4

Under the browser console, use getElementById () or getElementsByName () to get it, and then use custom js in the data element to get storage.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

Under the browser console, use getElementById () or getElementsByName () to get it, and then use custom js in the data element to get storage.