0

I searched and tried various solutions (using xsl:variable for e.g.), but none worked.

Here is my case. This works, but I would like to pass xsl_value-of as argument to alert():

<a href="#" onclick="alert('text')"><xsl:value-of select="@naziv" /></a>

So it would be something like

<a href="#" onclick="alert('{<xsl:value-of select="@naziv" />}')"><xsl:value-of select="@naziv" /></a>

1 Answer 1

3

Use an attribute value template i.e.

<a href="#" onclick="alert('{@naziv}');"><xsl:value-of select="@naziv"/></a>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, far more elegant solution!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.