0 votes
by (220 points)
Is it possible to set variables from within html?

I&rsquo;m trying to build an interactive map with an SVG. The locations are linked with <a> tags, and it&rsquo;s working well - but I&rsquo;d like to be able to set some variables inside the <a> tags. Is this possible?

1 Answer

+1 vote
by (159k points)
selected by
 
Best answer

It depends on what exactly you mean by "set some variables inside".

You can use HTML Attributes to create an anchor <a> element equivalent of a Link with Setter markup based link.

You can also use a combination of the element's onXXXX event handlers and the Javascript based State API to assign values story variables.

by (220 points)
Ah! I missed that info in the documentation. Exactly what I was looking for!

Sorry for such a simple question, but thank you very much for the help!
...