Try this code:
function change(evt)
{
var svgdoc = evt.getTarget().getOwnerDocument();
var text = svgdoc.getElementById("text");
var child = text.getFirstChild();
child.setData("Hello again");
}
Bye
Peter
-----Urspr�ngliche Nachricht-----
Von: [email protected] [mailto:[EMAIL PROTECTED] Im Auftrag von
tamsvg
Gesendet: Montag, 2. Mai 2005 11:10
An: [email protected]
Betreff: [svg-developers] change text
Hi!
I need to change my svg text. I wonder why the following code is not
working:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="1000" xmlns:xlink="http://www.w3.org/1999/xlink"
height="800" id="svg"
xmlns="http://www.w3.org/2000/svg">
<!-- Javascript -->
<defs>
<script type="text/javascript"><![CDATA[
function change(evt)
{
var elem = evt.target,
var svgdoc = elem.ownerdocument;
var text = svgdoc.getElementById("text");
var child = text.firstChild;
child.data = "Hello again";
}
]]>
</script>
</defs>
<circle cx="50" cy="50" r="10" onclick="change(evt)"/>
<text x="20" y="20" id="text">Hello</text>
</svg>
Any suggestions?
tam
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/