Try this:
msg = document.getElementById('tspanmsg'); msg.innerHTML = 'New contents here.';
Best wishes, John
On 05/05/2017 14:17, Steve Litt wrote:
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');
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