Adding Elements into SVG tag
-
Guys; I am developing an ajax control that has an svg element. I want to add graphics to this svg on certain ui events. I have tried both
svg.innerHTML += elementHtml;
, andsvg.appendChild(element);
. But both didn't display the desired graphic. what should I do?Help people,so poeple can help you.
-
Guys; I am developing an ajax control that has an svg element. I want to add graphics to this svg on certain ui events. I have tried both
svg.innerHTML += elementHtml;
, andsvg.appendChild(element);
. But both didn't display the desired graphic. what should I do?Help people,so poeple can help you.
The problem was in creating the element. I just used
document.createElementNS()
instead ofdocument.createElement
and it worked.Help people,so poeple can help you.