Using javascript, how do I copy svg tspan elements inside an svg text element into a different text element? -
i have svg text element 2 tspan elements. looks this.
<text id="majnote5" x="25" y="70"> <tspan>d</tspan> <tspan font-family="'opus text'" font-size="25">b</tspan> </text> i have 2nd empty text element looks this.
<text id="majchord1" x="425" y="70" ></text> i want copy both tspan elements , respective texts in first text element 2nd text element.
i tried following:
var majnote5 = document.getelementbyid('majnote5'); var majchord1 = document.getelementbyid('majchord1'); majchord1.textcontent = majnote5.textcontent; this copy text contents of tspan elements , places in other container, without of tspan elements. afterward looks this:
<text id="majchord1" x="25" y="70">db</text> how second text container first container?
thanks, --christopher
Comments
Post a Comment