This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SVG javaScript method to set text content

 
Juan Rolando Prieur-Reza
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can someone tell me how to set the text content of an SVG text Element
in javascript (ecmascript)?

Here is a sample of the problem:

My question is, what is the setmethod??, or the name of an "attribute" that will assign the text to this SVG text Element?

Explanation: The sample code illustrates how to use javaScript to create and set attributes to SVG elements such as rect, circle, and text (assuming you just want to modify attributes of a known text element by its "id").
I just can't find how to set the body content. Static SVG code will not suite my application.

Thanks for your help.
 
Juan Rolando Prieur-Reza
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, nevermind. I figured it out. The solution is to make the text content a child. I just had to find the method to set child:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic