DTM Rule based Event Handler

nelson_dalmeida

15-10-2015

I have created an onClick Event Based Rule in Adobe DTM and clicked the “Apply event handler directly to element”.

My CSS Selector is “div.mainTopNav a , a.InfoLinkItem”.

 

I want to access the clicked anchor tag’s href and text value, but I do not know how to reference the object of the clicked event and it’s corresponding element in the Custom Code Page.

Please could you help me with this?

Accepted Solutions (1)

Accepted Solutions (1)

shawncreed1

15-10-2015

You would simply use 'this' in custom code to reference the object that was targeted by the rule.  So, for example, if you wanted to get the title attribute of the link referenced in your example above, you could use custom code like:

var linkTitle = this.getAttribute("title");

Hope this helps!

-Shawn

Answers (0)