Reading html attributes with custom javascript variable

Hi,

I try to use custom javascript for reading html attributes of the clicked element:

function () { 
var elementRole = {{ClickElement}}.getAttribute("role");
return elementRole;}

This causes a

Uncaught SyntaxError: Unexpected token '{'

How do I fix this?

Hi,

See

and

for workarounds for this.

Thanks, this confirms what I suspected.

I thought using html attributes would simplify tracking but it seems just to complicate things :slight_smile: