I need to append elements that are in string into svg.I used the below code to do this.
var namespaceURI = "http://www.w3.org/2000/svg";
var svg = document.createElementNS(namespaceURI, "svg");
svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
$(svg).append('<path d="M10,20 L20,30" fill="pink" stroke="gray"></path>');
But it is created as html element and nothing is on screen.In jquery we usually do like $( "p" ).append( "<strong>Hello</strong>" )
to append elements.
I referred this link too. But I dont want to create new element using document.createElementNS(..)
.Instead I need to append element specified in string.
Is there any options to do this??