![](https://secure.gravatar.com/avatar/41e7a39428c47f8fe4125d5b8e0f24bd.jpg?s=120&d=mm&r=g)
Am 05.05.2017 um 15:17 schrieb Steve Litt:
Hi all,
I've pretty much got it down for clickmapping with SVG elements using onmouseover, onmouseout and onclick to run Javascript from my HTML file. Now I'm trying to do the whole thing inside my SVG file, for simple stuff.
For instance, I have a text/tspan element and a rectangle. When I hover the rectangle I'd like the text to change (perhaps from "init" to "hovered").
A few questions:
In what program must I look at my SVG file in order to see the effects of its internal javascript? Inkscape? Chromium? Something else?
When doing javascript exclusively from within my SVG file, what syntax should I use in order to change the text in a tspan? The following failed to work, doing nothing:
msg = document.getElementById(tspanmsg); msg.node.textContent('shunk');
- Maybe you need quotes around the id?
And yes, a web browser is the tool of choice to play javascript. It doesn't work in Inkscape. For troubleshooting and debugging javascript, you can use the browser console.
Maren
If I removed the "node." from the second line above, that didn't work either.
Thanks,
SteveT
Steve Litt May 2017 featured book: Twenty Eight Tales of Troubleshooting http://www.troubleshooters.com/28
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user