Amen Ra
Amen Ra

Reputation: 2851

Is there a way to put html data attribute on struts html:link tag?

I have a problem where I cannot put analytic code on my struts html:link tag. The code won't render if I put a data-analytics attribute on like this:

<html:link styleClass="analytics-click"
           action="${globalSites_context}${forgotPasswordAction}"
           title="${forgotPasswordLink}"
           data-analytics='{"location":"BrandBar","description":"BrandBar forget password"}'>${forgotPasswordLink}
</html:link> 

What can I do?

Upvotes: 1

Views: 935

Answers (1)

Roman C
Roman C

Reputation: 1

Change code to plain HTML

<a class="analytics-click"
   href="${globalSites_context}${forgotPasswordAction}"
   title="${forgotPasswordLink}"
   data-analytics='{"location":"BrandBar","description":"BrandBar forget password"}'>${forgotPasswordLink}
</a>

Upvotes: 2

Related Questions