Document.getElementByTagName(“svg_text”) is not working

hari

New Member
\[code\]document.createSvg = function(tagName) { var svgNS = "http://www.w3.org/2000/svg"; return this.createElementNS(svgNS, tagName);};var svgPie = document.createSvg("svg");metric_name = document.createSvg("g");text_metric = document.createSvg("text");text_metric.appendChild(document.createTextNode(data['name']));text_metric.setAttribute("name",data['name']);text_metric.setAttribute("text-anchor","start");text_metric.setAttribute("font-size","13");text_metric.setAttribute("id", data['id']);resetList = document.getElementsByTagName("text");alert(resetList[0]); metric_name.appendChild(text_metric);svgPie.appendChild(metric_name);\[/code\]Above alert is giving me undefined. Can you give the reason and solution to resolve it
 
Back
Top